wxEuphoria -- Custom Dialog During Progress Bar Execution
I'm having a problem with trying to invoke a custom dialog while a progress
bar is active. The dialog does not respond to input, and the app locks-up.
A canned dialog, like message_box, works fine though. Any help, as always,
would be greatly appreciated. Here is the offending code:
without warning
with trace
include wxEuphoria.e
include wxDialog.e
include wxText.e
include wxButton.e
atom void, vs, hs
constant
MainFrame = create( wxFrame, {0, -1, "Main", 120, 120, 500, 400} ),
MainPanel = create( wxPanel, {MainFrame}),
MainBtn = create( wxButton, {MainPanel, -1, "Start"}),
CustomDialog = create( wxDialog, {MainPanel, -1, "Help, I'm stuck",
250, 250, 180, 100}),
CDlgCancelBtn = create( wxButton, {CustomDialog, -1, "Cancel"})
procedure start_progress()
integer max_progress
atom load_progress, import_progress
max_progress = 1000
import_progress = 1
load_progress = create( wxProgressDialog, {"Progress label",
"Progress", max_progress, MainPanel})
for i = 1 to 1000 do
void = progress_update( load_progress, i,"")
if i = 500 then
void = show_modal(CustomDialog)
end if
end for
end_modal( load_progress, 1 )
if platform() = WIN32 then
delete_instance( load_progress )
end if
end procedure
procedure un_load_dialog( atom this, atom event_type, atom id, atom event )
end_modal ( CustomDialog, -1 )
end procedure
set_event_handler(CDlgCancelBtn, -1, wxEVT_COMMAND_BUTTON_CLICKED,
routine_id( "un_load_dialog" ))
set_event_handler(CustomDialog, get_id(CustomDialog), wxEVT_CLOSE_WINDOW,
routine_id( "un_load_dialog" ))
procedure click_button( atom this, atom event_type, atom id, atom event )
start_progress()
end procedure
set_event_handler(MainBtn, -1, wxEVT_COMMAND_BUTTON_CLICKED, routine_id(
"click_button" ))
wxMain( MainFrame )
|
Not Categorized, Please Help
|
|