My favorites | Sign in
Project Hosting will be READ-ONLY Thursday at 3:00pm UTC for up to 3 hours for network maintenance.
Project Home Downloads Wiki Issues Source
Search
for
GuideToPorting  
Differences between C++ and BlitzMax wxWidgets applications
Updated Feb 4, 2010 by woolly...@gmail.com

to do...

Comment by project member woolly...@gmail.com, Sep 11, 2007

Introduction

Event Handling

The usual method in a C++ app is to use an event table, defined statically, using macros, along the lines of :

BEGIN_EVENT_TABLE(MyFrame, wxFrame)
    EVT_MENU(wxID_EXIT,  MyFrame::OnQuit)
    EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
END_EVENT_TABLE()

In BlitzMax, we instead use Connect() to attach a specific event to a callback function:

    Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, OnQuit)
    Connect(wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, OnAbout)

They essentially do exactly the same job, except that the event table is fixed and we can Connect/Disconnect at any time.

You can look at the EventMappings to see how each macro can be employed by an equivalent Connect call.


Sign in to add a comment
Powered by Google Project Hosting