lyle at knology.net
2006-Jun-06 14:02 UTC
[fxruby-users] setCurrent switcher index out of bounds problem
On Tue, 06 Jun 2006 09:49:56 +0200, Axel Etzold <AEtzold at gmx.de> wrote :> Now, I need to add the possibility to switch between > different layers of the right pane, just like in the > shutter.rb application, where you press one of the > ShutterButtons on the left to have that behaviour.OK.> Then, I get the error below. > What is the problem here ?Looking at your code example, I don''t see where you''re actually adding any content to the switcher. It''s empty, so when you tell it to switch to a different page (by setting @switcher.current to a new value) you''re getting an error.
Axel Etzold
2006-Jun-07 14:38 UTC
[fxruby-users] setCurrent switcher index out of bounds problem
Dear Meinrad, Dear Lyle, thank you for your responses. Meinrad: my problem was not so much to identify an error line number, but to get some grasp of what constant actually does what in FXRuby. This generates a lot of silly questions to more experienced people, of course. Sorry for that. So I find that in any learning process, redundancy is a good thing. It may be very nice to have one example for each particular behaviour FXRuby offers, but if you''re learning it, this may not be enough to disambiguate the silly things one thinks a program does from those that actually happen. I am just starting FXRuby now, but I use Ruby for command-line things for a longer period of time. It is the first language I feel I can talk about serious things to a computer - otherwise, in university maths studies, you may well acquire computer knowledge like other people learn Old Greek or Sanskrit: not much practical use in today''s Greece or India ... So I''d suggest to you FXRuby experts to write a book like Hal Fulton''s The Ruby Way - plenty of code for disambiguation ... . There really may be a need for it, as amazon doesn''t show me any book entirely about FOX or FXRuby. (I know of Ruby Developer''s guide, but here FXRuby is one of many topics.) Then again, I''ve got another question I couldn''t find an answer to : In one field of an FX4Splitter, I want to display a PNG image. I know how to do this (basically) from the imageviewer.rb file. But the image I display needs to be generated first (by Gnuplot ... no problem to output PNG from there, except one: to set the size : I don''t know what to tell Gnuplot there: - how do I see what the size of that @imageview_rec = FXImageView.new(@topFrame_rec, nil, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y) is ? I tried p @imageview_rec.getHeight p @imageview_rec.getWidth but that gives me 1 and 1. Thank you and sorry for my annoying questions, Best regards, Axel>?-------- Original-Nachricht -------- >?Datum: 6 Jun 2006 14:02:09 -0000 >?Von: "lyle at knology.net" <lyle at knology.net> >?An: fxruby-users at rubyforge.org >?Betreff: Re: [fxruby-users] setCurrent switcher index out of bounds problem >?
> On Tue, 06 Jun 2006 09:49:56 +0200, Axel Etzold <AEtzold at gmx.de> wrote : > > > Now, I need to add the possibility to switch between > > different layers of the right pane, just like in the > > shutter.rb application, where you press one of the > > ShutterButtons on the left to have that behaviour. > > OK. > > > Then, I get the error below. > > What is the problem here ? > > Looking at your code example, I don''t see where you''re actually adding any > content to the switcher. It''s empty, so when you tell it to switch to a > different page (by setting @switcher.current to a new value) you''re > getting > an error. > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users-- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
Meinrad Recheis
2006-Jun-07 20:19 UTC
[fxruby-users] setCurrent switcher index out of bounds problem
On 6/7/06, Axel Etzold <AEtzold at gmx.de> wrote:> Dear Meinrad, > Dear Lyle, > > thank you for your responses. > Meinrad: my problem was not so much to identify > an error line number, but to get some grasp > of what constant actually does what in FXRuby. > This generates a lot of silly questions to more > experienced people, of course. Sorry for that.i''m sorry because i did not understand your question right and therefore gave a answer that was not helpful. Anyway, I am not an expert in FXRuby. lyle is the real expert. i am just trying my best to give my experience to people who are new to FXRuby. [...]> > Then again, I''ve got another question I couldn''t find > an answer to : > In one field of an FX4Splitter, I want to display a PNG > image. > I know how to do this (basically) from the imageviewer.rb > file. > But the image I display needs to be generated first > (by Gnuplot ... no problem to output PNG from there, > except one: to set the size : I don''t know what > to tell Gnuplot there: > - how do I see what the size of that > > @imageview_rec = FXImageView.new(@topFrame_rec, nil, nil, 0, > LAYOUT_FILL_X|LAYOUT_FILL_Y) > > is ? > I tried > p @imageview_rec.getHeight > p @imageview_rec.getWidth > > but that gives me 1 and 1.i also often had the problem that a widget did not give back it''s real size but 1x1 instead. maybe making a layoutcontainer (verticalframe or packer) around the imageview might help. then you can get the containers width and height.> > Thank you and sorry for my annoying questions,they are not at all annoying. ;) -- henon
Axel Etzold
2006-Jun-09 18:58 UTC
[fxruby-users] Showing a window, closing it, showing it again - error
Dear all, in a GUI, I have a help window with some text and a Menu toolbar button quite similar to that of textedit.rb: a help window of class FXDialog appears, displays a help text, and if you don''t need it anymore, there is a button to close it. This works :) But when the user wants to see the help window again, and re-presses the menubar help button, the whole program exits saying: c:/axelhome/ngui/f30.rb:686:in `show'': This FXDialogBox * already released (RuntimeError) from c:/axelhome/ngui/f30.rb:686:in `onCmdShowHelp'' from c:/axelhome/ngui/f30.rb:893:in `runme'' from c:/axelhome/ngui/f30.rb:902 This is the function I used : class MainWindow def initialize ... # Help window # init HelpWindow as in helpwindow.rb required by textedit.rb @helpwindow = HelpWindow.new(self) end # Show help window def onCmdShowHelp(sender, sel, ptr) @helpwindow.show(PLACEMENT_CURSOR) # line that generated the error. return 1 end end How can I make help re-accessible ? In textedit.rb this works, but I don''t know why. Thank you, Best regards, Axel -- Echte DSL-Flatrate dauerhaft f?r 0,- Euro*! "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
Meinrad Recheis
2006-Jun-09 19:35 UTC
[fxruby-users] Showing a window, closing it, showing it again - error
On 6/9/06, Axel Etzold <AEtzold at gmx.de> wrote:> Dear all, > > in a GUI, I have a help window with some text and a > Menu toolbar button quite similar to that of textedit.rb: > a help window of class FXDialog appears, displays a > help text, and if you don''t need it anymore, there is > a button to close it. This works :) > But when the user wants to see the help window again, > and re-presses the menubar help button, the whole > program exits saying: > > > c:/axelhome/ngui/f30.rb:686:in `show'': This FXDialogBox * already released (RuntimeError) > from c:/axelhome/ngui/f30.rb:686:in `onCmdShowHelp'' > from c:/axelhome/ngui/f30.rb:893:in `runme'' > from c:/axelhome/ngui/f30.rb:902 > > This is the function I used : > > class MainWindow > > def initialize > ... > # Help window > > # init HelpWindow as in helpwindow.rb required by textedit.rb > @helpwindow = HelpWindow.new(self) > end > # Show help window > def onCmdShowHelp(sender, sel, ptr) > @helpwindow.show(PLACEMENT_CURSOR) # line that generated the error. > return 1 > end > end > > How can I make help re-accessible ? In textedit.rb this works, > but I don''t know why. > > Thank you, > > Best regards, > > Axelaxel, there are two ways to do it: 1) not destroying the window just hiding it. 2) calling create everytime you want to show it again. hth, -- henon
Axel Etzold
2006-Jun-18 21:01 UTC
[fxruby-users] "Checking" individual properties in a container as in foxGUIb ?
I would like to set up a container of properties, just as there is one in the "properties" section of the splitter window in foxGUIb. I managed to do this using a function much like the make_container and add_prop_manipulator methods of foxGUIb.rb, respectively its required files. Now, I need to be able to set some of those properties as checked or unchecked and to attach some methods to them. For instance, I have a two property fields for two- and three-dimensional data sets. Now, if the two-dimensional property is checked, I''d like to uncheck a property for z-axis name automatically. How could this be done ? Thank you very much, Best regards, Axel -- Echte DSL-Flatrate dauerhaft f?r 0,- Euro*! "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl