Events

Events
Using events with wxEuphoria

Event handler procedures take 4 arguments:

Notes

wxEVT_PAINT Event

During a paint event, you need to create a wxPaintDC. This must be destroyed ( delete_instance ) before you return from the paint handler. Also, any drawing that is done should be within calls to begin_drawing() and end_drawing():

Example:


    procedure onPaint( atom this, atom event_type, atom id, atom event )
        atom dc

        dc = create( wxPaintDC, {this} )
        begin_drawing(dc)
        -- ... do drawing here...
        end_drawing(dc)
        delete_instance(dc)
    end procedure

Key Events

Key events under Linux should be set with an id of -1. Also, no events will be passed until the window has been clicked by the user.

Event Constants

Full listing of events as defined in wxeud.e:

Functions/Procedures
Subtopics

Events

[func]
can_veto
( atom event )

Category: Events

Returns: True or false Used to determine if the wxEVT_CLOSE_WINDOW event can be vetoed.


Events

[proc]
set_event_handler
( object this, object id, object event, integer rid )

Category: Events

Set up an event handler.

Example:


    procedure myWindow_onClose( atom this, atom event_type, atom id, atom event )
        exit_main()
    end procedure
    set_event_handler( myWindow, wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, routine_id("myWindow_onClose") )

See class documentation for valid event constants.


Events

[proc]
skip
( atom event )

Category: Events

Called by an event handler to tell the event system that the event handler should be skipped, and the next valid handler used instead.