in reply to Wx::ProgressDialog, please help

Works for me (after I fixed up your snippet ofcourse). Which version of Wx do you have?
package crap; use Wx; use base qw(Wx::ProgressDialog); sub new { my $class = shift; my $max = shift || 10; my $vars = (wxPD_CAN_ABORT| wxPD_APP_MODAL|wxPD_ELAPSED_TIME| wx +PD_ESTIMATED_TIME| wxPD_REMAINING_TIME); my $this = $class->SUPER::new("xp6 progres ($max)", "the progres +s ($max)", $max, undef, $vars); $this->Show(1); return $this; } my $c = crap->new(); for(0 .. 10){ $c->Update($_,"the progress ($_/10)",); select undef,undef,undef,0.3; }

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^2: Wx::ProgressDialog, please help
by jettero (Monsignor) on Jul 27, 2004 at 13:07 UTC
    That's strange that it works for you.

    I just tried yours and I get the same thing. The window is there, but no widgets get drawn until the whole thing is done.

    I'm on Wx-0.20 and wxGTK-2.4.2-3.fr on teh lunix, but it also doesn't work right in windows: Wx-0.19 with wxMSW-2.4.2 (binary). I tried both mine and yours in windows a second ago.

    However, in windows, it doesn't dork around drawing an empty window, it simply sagfaults and kills perl.exe. The 215789 example does work great in windows and gtk.

    So, now I'm guessing that progressdialogs can be made to work without a parent window, but it's flaky and partly luck based?

      Try this version :)
      package crap; use strict; use warnings; use Wx qw[ wxPD_CAN_ABORT wxPD_APP_MODAL wxPD_ELAPSED_TIME wxPD_EST +IMATED_TIME wxPD_REMAINING_TIME ]; use base qw(Wx::ProgressDialog); sub new { my $class = shift; my $max = shift || 10; my $vars = (wxPD_CAN_ABORT| wxPD_APP_MODAL|wxPD_ELAPSED_TIME| wx +PD_ESTIMATED_TIME| wxPD_REMAINING_TIME); my $this = $class->SUPER::new("xp6 progres ($max)", "the progres +s ($max)", $max, undef, $vars); $this->Show(1); return $this; } my $c = crap->new(); for(0 .. 10){ $c->Update($_,"the progress ($_/10)",); select undef,undef,undef,0.3; }
      BTW - for posterity, I have WXMSW-2.5.2, Wx-0.20 .

      It could be a wxGtk bug, you should ask on the wxper-users list.

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

        Same thing. It doesn't draw the progress (or anything else) at all until it gets to Update(10) under my .20/2.5.3 GTK install and simply sagfaults under .19/2.5.2 windows install.

        I find it crazy and random that it DOES work for you.

        I wonder if it's my perl version.
        lunix: v5.8.3 built for i686-linux-thread-multi
        winblows: v5.8.3 built for MSWin32-x86-multi-thread

        could be the 5.8.3, could be the threads... What perl version are you using?

        And thanks for your help btw... I will try the list also.