Andreas S
2008-Dec-04 01:50 UTC
[fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class
Hi,
I''m writing a custom SplashScreen because I can''t convey
loading status with FXSplashWindow. While FXSplashScreen does that, it has that
OK button to close it. I want it to close by itself when my process is done.
The following code works fine, but when it is wrapped in a class, I get
segmentation fault. Did I make a mistake in the start up sequence? But the fact
that it doesn''t seg-fault when it is outside of a class, makes it looks
like a bug to me.
Any idea how to work around it?
-andre
require ''fox16''
include Fox
class Splash < FXDialogBox
def action
Thread.new do
yield
handle nil, FXSEL(SEL_COMMAND,ID_ACCEPT), nil
end
end
end
#class App # uncomment this to see segmentation fault
# def self.start
app = FXApp.new(''a'', ''b'')
splash = Splash.new app, ''splash'', :width => 300,
:height => 200
splash.action do
sleep 1 # Simulating data loading
end
app.create
splash.show PLACEMENT_SCREEN
puts "RUN"
app.runModalWhileShown splash
puts "Begin real"
win = FXMainWindow.new app, ''joe'', :width => 500,
:height => 400
win.show PLACEMENT_SCREEN
win.create
puts "App run"
app.run
# end
#end
#App.start
_________________________________________________________________
Suspicious message? There?s an alert for that.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/fxruby-users/attachments/20081204/1299f1a3/attachment.html>
Lyle Johnson
2008-Dec-04 20:27 UTC
[fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class
On Dec 3, 2008, at 7:50 PM, Andreas S wrote:> I''m writing a custom SplashScreen because I can''t convey loading > status with FXSplashWindow. While FXSplashScreen does that, it has > that OK button to close it. I want it to close by itself when my > process is done. > > The following code works fine, but when it is wrapped in a class, I > get segmentation fault. Did I make a mistake in the start up > sequence? But the fact that it doesn''t seg-fault when it is outside > of a class, makes it looks like a bug to me. > > Any idea how to work around it?Your code runs fine for me (i.e. without crashing) when I uncomment the lines that "wrap" the main code with the App class. I wonder if it''s just a timing thing; what happens if you make it sleep a couple of seconds (sleep 2 or more) instead of just one? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081204/54ea2714/attachment.html>
Andreas S
2008-Dec-04 21:48 UTC
[fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class
Hi Lyle, Thanks for looking at this. I forgot to mention that I was using ruby 1.8.7-p72 (also tried 1.8.7-p22). Since you didn''t have the problem, I re-installed 1.8.6+p114 and tried again. Everything went smoothly. I can only conclude the problem is with ruby 1.8.7. Did you try it with 1.8.6? I''m jumping ahead here, but suppose that is the case, then herewith I''m reporting fxruby seg-faulting with ruby 1.8.7. I''m not sure how important this case is for you to spend time on it. For now I can go back and use 1.8.6 to avoid this problem. Thanks again, Lyle -andre _________________________________________________________________ Suspicious message? There?s an alert for that. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081204/ea64e6f7/attachment.html>
Lyle Johnson
2008-Dec-05 00:36 UTC
[fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class
Actually, I was running it with Ruby 1.9.1. I will try again tomorrow with 1.8.7, but I''d recommend sticking with 1.8.6. Hope this helps, Lyle On Dec 4, 2008, at 3:48 PM, Andreas S <andreas_s at hotmail.com> wrote:> Hi Lyle, > > Thanks for looking at this. I forgot to mention that I was using > ruby 1.8.7-p72 (also tried 1.8.7-p22). Since you didn''t have the > problem, I re-installed 1.8.6+p114 and tried again. Everything went > smoothly. I can only conclude the problem is with ruby 1.8.7. Did > you try it with 1.8.6? > > I''m jumping ahead here, but suppose that is the case, then herewith > I''m reporting fxruby seg-faulting with ruby 1.8.7. > > I''m not sure how important this case is for you to spend time on it. > For now I can go back and use 1.8.6 to avoid this problem. > > Thanks again, Lyle > -andre > > Suspicious message? There?s an alert for that. Get your Hotmail? > account now. > _______________________________________________ > 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/20081204/129fd485/attachment.html>
Andreas S
2008-Dec-05 07:54 UTC
[fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class
1.9? That''s interesting. Actually I wanted to try 1.9 to speed things up a little bit, but didn''t know fxruby already supports 1.9. I just tried to install it with the latest 1.9.1-preview2, but it won''t build. Something with ''len'' is not a member of RArray struct anymore. ''len'' is a union member now in 1.9. I regret that my C is not good enough to understand whether this is the problem or not. Just FYI. -andre From: lyle at lylejohnson.name To: fxruby-users at rubyforge.org Date: Thu, 4 Dec 2008 18:36:56 -0600 Subject: Re: [fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class Actually, I was running it with Ruby 1.9.1. I will try again tomorrow with 1.8.7, but I''d recommend sticking with 1.8.6. Hope this helps, Lyle On Dec 4, 2008, at 3:48 PM, Andreas S <andreas_s at hotmail.com> wrote: Hi Lyle, Thanks for looking at this. I forgot to mention that I was using ruby 1.8.7-p72 (also tried 1.8.7-p22). Since you didn''t have the problem, I re-installed 1.8.6+p114 and tried again. Everything went smoothly. I can only conclude the problem is with ruby 1.8.7. Did you try it with 1.8.6? I''m jumping ahead here, but suppose that is the case, then herewith I''m reporting fxruby seg-faulting with ruby 1.8.7. I''m not sure how important this case is for you to spend time on it. For now I can go back and use 1.8.6 to avoid this problem. Thanks again, Lyle -andre Suspicious message? There?s an alert for that. Get your Hotmail? account now. _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users _________________________________________________________________ Send e-mail anywhere. No map, no compass. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_anywhere_122008 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081205/dc7a735e/attachment-0001.html>
Lyle Johnson
2008-Dec-05 13:57 UTC
[fxruby-users] Custom SplashScreen. Seg fault when wrapped in a class
On Dec 5, 2008, at 1:54 AM, Andreas S wrote:> 1.9? That''s interesting. Actually I wanted to try 1.9 to speed > things up a little bit, but didn''t know > fxruby already supports 1.9. > > I just tried to install it with the latest 1.9.1-preview2, but it > won''t build.Yes, I was running against my development version (which has fixes for Ruby 1.9.1). As soon as Ruby 1.9.1 goes final, I''ll do another FXRuby release for that. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081205/cde0d5ed/attachment.html>