Hello Mark,
WindowDisabler sounds doable, but there wasn't much documentation I can
use to figure out how to use it.
In any case, the simple solution that I found was to simply call
Update() on the dialog to force it to repaint itself.
Mark Dootson wrote:
Hi,
Use a frame with the appropriate style settings (fixed border etc) and
once shown set a
Wx::WindowDisabler to prevent user input to app.
Whatever mechanism you have chosen to make your long running work none
blocking will allow the window to update.
Regards
Mark
Foo JH wrote:
Hey Mark,
Thanks for the insight. I did explore ShowModal. It worked (as in the
text was painted), but the dialog held control of the app
(effectively freezing the application).
In my case, I wanted to use the dialog as a means to visually inform
the user that some work is going on. The plan was to open the dialog,
do the work, then close the dialog when it is done.
One possible way to do this is to move the business logic into the
dialog itself. It should work, though I'd like to consolidate all
business logic together.
Your thoughts?
Mark Dootson wrote:
Hi,
Because you have no mechanism to deliver events to the dialog.
Try
$dlg->ShowModal();
OR
Start off an app
my $app = Wx::SimpleApp->new();
my $dlg = .... your code
$dlg->Show(1);
$app->MainLoop;
Though in second case you need to put code in $dlg to kill loop on
exit.
Cheers
Mark
Foo JH wrote:
Hi all,
I'm wondering why my Wx::StaticText is not painted in my test
dialog. The following is the code I used:
my $dlg = Wx::Dialog->new(
$this,
-1,
'SMARTSync Dialog',
wxDefaultPosition,
[200,70],
);
my $MainSizer = Wx::BoxSizer->new(wxVERTICAL);
$dlg->SetSizer($MainSizer);
my $label = Wx::StaticText->new($dlg,-1,
"Can you read me?");
$MainSizer->Add($label,0,wxALL|wxGROW,5);
$dlg->Show(1);
The dialog window shows, but the part where the text should be
painted is transparent.
Any help is appreciated. Thanks.