Re: wxEuphoria no event triggered
- Posted by jacques deschĂȘnes <desja at globet?ott?r.net> Jan 24, 2008
- 563 views
Its what I tried at first but it doesn't work. I tried: constant IDD_BUTTON_xxx = new_id()-- declared buttons id like this -- first try (for each button) set_event_handler(button, IDD_BUTTON_xxx, ....) -- second try (for each button) set_event_handler(button,get_id(button), ....) -- third try set_event_handler(dlg,{IDD_BUTTON_xx1,IDD_BUTTON_xx2,IDD_BUTTON_xx3},...) none of the above works Greg Haberek wrote: > > 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: > > }}} <eucode> > 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")) > </eucode> {{{ > > > So it looks like you need to do this: > > }}} <eucode> > set_event_handler( Button, get_id(Button), wxEVT_COMMAND_BUTTON_CLICKED, > routine_id("event_handler")) > </eucode> {{{ > > > HTH, > > -Greg