Re: wxEuphoria no event triggered

new topic     » goto parent     » topic index » view thread      » older message » newer message

jacques deschĂȘnes wrote:
> 
> What's wrong with the following code. When I click buttons no event handler
> is called.
> 
> (snip)


 From dialog_demo.exw provided with wxEuphoria:

procedure on_start( atom this, atom event_type, atom id, atom event )
        -- reset the progress counter
        my_progress = 0
        
        -- create a progress dialog
progress = create( wxProgressDialog, {"dialog_demo.exw", "How are we
        doing?", 10, main,
                wxPD_CAN_ABORT + wxPD_ELAPSED_TIME + wxPD_REMAINING_TIME})
                
        -- we'll use a timer to update the progress
        start_timer( timer, 1000, 0 )
        
        -- start the dialog
        if not show_modal( progress ) then
                -- the dialog returned zero, which means the user
                -- hit the cancel button
void = message_box( "Ok, stopped early", "Progress Halted",
                wxICON_WARNING )
                my_progress = 0
        end if
        if platform() = WIN32 then
                delete_instance( progress )
        end if
end procedure
set_event_handler( start, get_id(start), wxEVT_COMMAND_BUTTON_CLICKED,
        routine_id("on_start"))



So it looks like you need to do this:

set_event_handler( Button, get_id(Button), wxEVT_COMMAND_BUTTON_CLICKED,
routine_id("event_handler"))



HTH,

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu