wxEuphoria no event triggered
- Posted by jacques deschênes <desja at globetr?tter.ne?> Jan 24, 2008
- 588 views
What's wrong with the following code. When I click buttons no event handler is called.
procedure select_prog2edit(integer enable_suppress) atom dlgSelectProg, btnSelectOk, btnSelectCancel, btnSelectDelete object fnVal sequence choices prog_id = 0 prog2edit = {} choices = {} for i = 1 to length(programs) do choices = append(choices,programs[i][SESSION_NAME]) end for dlgSelectProg = create(wxDialog,{CTrainerMainWin,-1,"Sélection du programme",-1,-1,300,305}) ProgListBox = create(wxListBox,{dlgSelectProg,IDD_LISTBOX,10,10,280,200,choices}) btnSelectOk = create(wxButton,{dlgSelectProg,IDD_SELECT_OK,"A&ccepter", 20,220,60,30}) btnSelectCancel = create(wxButton,{dlgSelectProg,IDD_SELECT_CANCEL,"&Annuler",210,220,60,30}) if enable_suppress then btnSelectDelete = create(wxButton,{dlgSelectProg,IDD_SELECT_DELETE,"&Supprimer",115,220,60,30}) set_event_handler(dlgSelectProg,{IDD_SELECT_OK,IDD_SELECT_CANCEL,IDD_SELECT_DELETE},wxEVT_COMMAND_BUTTON_CLICKED, routine_id("evt_select_prog2edit")) else set_event_handler(dlgSelectProg,{IDD_SELECT_OK,IDD_SELECT_CANCEL},wxEVT_COMMAND_BUTTON_CLICKED, routine_id("evt_select_prog2edit")) end if fnVal = show_modal(dlgSelectProg) if platform()=WIN32 then delete_instance(dlgSelectProg) end if if fnVal = IDD_SELECT_CANCEL then return else if fnVal > 0 and fnVal <= length(programs) then prog_id = fnVal prog2edit = programs[prog_id] end if return end if end procedure