Hey all, I''m having trouble with FXProgressDialog-- I''m trying to use it to show the progress of a file upload.. I am running the upload in a separate thread that calls the dialog''s destroy method when its done.. the dialog closes, but the application remains non-responsive (as if its still in the execute loop). I''ve tried sending ID_ACCEPT to the dialog with the same results. I''ve seen some other threads on this list (and others) with the same issue, with no solution... can someone point me to an example of successfully using this dialog? Thanks.. Maurice ------------------------- code snippet: -- in my FXMainWindow: progress = FXProgressDialog.new(self, "Upload Progress", "Starting upload") th = Thread.new { # this does the upload, and calls progress.increment and sets progress.message OpenomyUploader.upload(dir, tags, progress) progress.destroy } progress.execute -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060306/61ed144f/attachment.htm
i had the same issue with dialogbox. i could only work around by making the dialogbox nonmodal. everything else failed for me too. maybe it works for you if you call progress.show instead of progress execute. but then the progress dialog would not be modal anymore. let''s wait on lyle''s comment ;) ... sadly he has been not responding on the list for a while now. -- henon On 3/7/06, Maurice Codik <maurice.codik at gmail.com> wrote:> > Hey all, > > I''m having trouble with FXProgressDialog-- I''m trying to use it to show > the progress of a file upload.. > > I am running the upload in a separate thread that calls the dialog''s > destroy method when its done.. the dialog closes, but the application > remains non-responsive (as if its still in the execute loop). I''ve tried > sending ID_ACCEPT to the dialog with the same results. > > I''ve seen some other threads on this list (and others) with the same > issue, with no solution... can someone point me to an example of > successfully using this dialog? > > Thanks.. > > Maurice > > ------------------------- > > code snippet: > > -- in my FXMainWindow: > > progress = FXProgressDialog.new(self, "Upload Progress", "Starting > upload") > > th = Thread.new { > # this does the upload, and calls progress.increment and sets > progress.message > OpenomyUploader.upload(dir, tags, progress) > progress.destroy > } > > progress.execute > > > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060307/43abc346/attachment.htm
On Mar 6, 2006, at 10:33 PM, Maurice Codik wrote:> I''m having trouble with FXProgressDialog-- I''m trying to use it to > show the progress of a file upload.. > > I am running the upload in a separate thread that calls the dialog''s > destroy method when its done.. the dialog closes, but the application > remains non-responsive (as if its still in the execute loop). I''ve > tried sending ID_ACCEPT to the dialog with the same results.So you are saying that instead of doing this: progress.destroy At the end of the thread, you''re doing this: progress.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) and that doesn''t stop the modal loop and close the dialog box?
I was actually using a different command, based on some advice you had given on ruby-talk a few years back, here: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/72014, this didnt stop the modal loop. Replacing progress.destroy with the method you gave actually causes a segfault! Perhaps I''m using an old version? uploader.rb:98: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [i386-mswin32] (line 98 is the call to progress.handle) using fxruby 1.4.3. Maurice On 3/7/06, Lyle Johnson <lyle at knology.net> wrote:> > > On Mar 6, 2006, at 10:33 PM, Maurice Codik wrote: > > > I''m having trouble with FXProgressDialog-- I''m trying to use it to > > show the progress of a file upload.. > > > > I am running the upload in a separate thread that calls the dialog''s > > destroy method when its done.. the dialog closes, but the application > > remains non-responsive (as if its still in the execute loop). I''ve > > tried sending ID_ACCEPT to the dialog with the same results. > > So you are saying that instead of doing this: > > progress.destroy > > At the end of the thread, you''re doing this: > > progress.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), > nil) > > and that doesn''t stop the modal loop and close the dialog box? > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060307/d34ea86e/attachment.htm
Hello Maurice,> I''m having trouble with FXProgressDialog-- I''m trying to use it to showthe progress of a file upload..> [...] > can someone point me to an example of successfully using this dialog?My sourceforge-project Piggy includes an FTP browser written in FXRuby but I do not use a separate thread. Termination doesn''t seem to be a problem there. I''ve noticed a few side effects, though. E. g. the modal Dialog which starts the upload will stay open until the upload is finished. BTW: If you are building an FTP browser, too, you might want to join in the project (or should I join yours)? Cheers Sascha -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060307/0abf0c04/attachment.htm
Hey Sascha, Thanks for the code example-- I used your approach and the dialog now works fine. I''m not writing an ftp client-- im writing a utility that will make uploading many files onto openomy.com (a file storage site I help run) a little easier. It calls: progress = FXProgressDialog.new(...) progress.create progress.show progress.repaint ... do stuff .. progress.hide Which is non-modal, but works fine as long as I dont create a new thread. Still, this doesnt feel like the "right" solution. I will try to use ID_ACCEPT again after I upgrade my Ruby/FXRuby later this week... Maurice On 3/7/06, Sascha D?rdelmann <sdruby at onlinehome.de> wrote:> > Hello Maurice, > > > I''m having trouble with FXProgressDialog-- I''m trying to use it to show > the progress of a file upload.. > > [...] > > can someone point me to an example of successfully using this dialog? > My sourceforge-project Piggy includes an FTP browser written in FXRuby but > I do not use a separate thread. Termination doesn''t seem to be a problem > there. I''ve noticed a few side effects, though. E. g. the modal Dialog which > starts the upload will stay open until the upload is finished. > > BTW: If you are building an FTP browser, too, you might want to join in > the project (or should I join yours)? > > Cheers > Sascha > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060309/8b243a22/attachment-0001.htm