From haroldworby at earthlink.net Sat Apr 2 21:16:14 2005 From: haroldworby at earthlink.net (Harold Worby) Date: Sat Apr 2 21:11:00 2005 Subject: [fxruby-users] Retriving FXTextField Data In-Reply-To: Message-ID: Ok, here's the complete function. The paramater passed as (cell) is handle to a FXTableItem. The calling line is dlgNewTest(cell) When then button.connect uses: getApp().stopModal(dlg, true) dlg.hide I get: table.rbw:224:in `stopModal': No matching function for overloaded 'FXApp_stopModal' (ArgumentError) And when I use: dlg.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) I Get: table.rbw:227:in `dlgNewTest': undefined method `FXSEL' for # NoMethodError) I'm guessing the the issue has to to do with the scope of the dlg object? What overloaded 'FXApp_stopModal'? ##################################################### def dlgNewTest(cell) dlg = FXDialogBox.new(getApp(),"Edit Destination",DECOR_TITLE|DECOR_BORDER,0,0,0,0) outter = FXVerticalFrame.new(dlg,LAYOUT_FILL_X|LAYOUT_FILL_Y) # Contents inner = FXHorizontalFrame.new(outter,LAYOUT_FILL_X|LAYOUT_FILL_Y) labels = FXVerticalFrame.new(inner,LAYOUT_FILL_X|LAYOUT_FILL_Y) lblName=FXLabel.new(labels,"Name",nil,LABEL_NORMAL) lblPath=FXLabel.new(labels,"Pathname",nil,LABEL_NORMAL) lblSize=FXLabel.new(labels,"Size Limit",nil,LABEL_NORMAL) fields = FXVerticalFrame.new(inner,LAYOUT_FILL_X|LAYOUT_FILL_Y) txtName=FXTextField.new(fields ,20 , nil,TEXTFIELD_NORMAL) txtName.text=@table.getItemText(cell.row,1) txtPath=FXTextField.new(fields ,66 , nil,TEXTFIELD_NORMAL) txtPath.text=@table.getItemText(cell.row,2) txtSize=FXTextField.new(fields ,12 , nil,TEXTFIELD_NORMAL) txtSize.text=@table.getItemText(cell.row,3) # Separator FXHorizontalSeparator.new(outter,LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|SEPARA TOR_GROOVE) # Bottom buttons buttons=FXHorizontalFrame.new(outter) # Accept btnAccept=FXButton.new(buttons, "&Accept", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) btnAccept.connect(SEL_COMMAND){|sender, selector, data| @table.setItemText(cell.row,1,txtName.text) @table.setItemText(cell.row,2,txtPath.text) @table.setItemText(cell.row,3,txtSize.text) #getApp().stopModal(dlg, true) #dlg.hide #gives table.rbw:224:in `stopModal': No matching function for overloaded 'FXApp_stopModal' (ArgumentError) dlg.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) #gives table.rbw:227:in `dlgNewTest': undefined method `FXSEL' for # (NoMethodError) } # Cancel btnCancel=FXButton.new(buttons, "&Cancel", nil, dlg, FXDialogBox::ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) btnCancel.connect(SEL_COMMAND){|sender, selector, data| } # Delete btnDelete=FXButton.new(buttons, "&Delete", nil, dlg, FXDialogBox::ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) btnDelete.connect(SEL_COMMAND){|sender, selector, data| sql="DELETE FROM DESTINATIONS WHERE " sql=sql + " name='" + txtName.text + "'" sql=sql + " and pathname='" + txtPath.text + "'" } dlg.create dlg.execute end ##################################################### > -----Original Message----- > From: fxruby-users-bounces@rubyforge.org > [mailto:fxruby-users-bounces@rubyforge.org]On Behalf Of Lyle Johnson > Sent: Tuesday, March 29, 2005 6:19 AM > To: Harold Worby > Cc: fxruby-users@rubyforge.org > Subject: Re: [fxruby-users] Retriving FXTextField Data > > > > On Mar 28, 2005, at 10:59 PM, Harold Worby wrote: > > > Now I added the '.connect(SEL_COMMAND){' and the data is correct, but > > the > > Accept button does not dimiss the diallog 'dlg'. > > As I read the docs, FXButton.new(parent, text, icon, target, selector, > > opts,...), > > should be creating a button that will send the message > > 'selecotor'(ID_ACCEPT > > hear) to the object 'target'(dlg here). > > Yes... > > > Which is what it seemed to do before I added the .connect(SEL_COMMAND) > > {block} > > I expect it catch the SEL_COMMAND message, execute the {block} and > > then send > > the ID_ACCEPT message. Why doesn't it? > > As soon as you call connect() on the button, it replaces the previously > designated message target (the dialog box) with a new one -- an > "anonymous" target, if you like, that responds to the SEL_COMMAND > message from the button. And FOX only allows one message target object > per widget, so in this case it's the latter object (the anonymous one) > that wins. > > To accomplish what you want, I'd just write it this way: > > FXButton.new(buttons, "&Accept", nil, nil, 0, > ...).connect(SEL_COMMAND) { > @table.setItemText(cell.row,1,txtName.text) > @table.setItemText(cell.row,2,txtPath.text) > @table.setItemText(cell.row,3,txtSize.text) > getApp().stopModal(dlg, true) > dlg.hide > } > > or more directly: > > FXButton.new(buttons, "&Accept", nil, nil, 0, > ...).connect(SEL_COMMAND) { > @table.setItemText(cell.row,1,txtName.text) > @table.setItemText(cell.row,2,txtPath.text) > @table.setItemText(cell.row,3,txtSize.text) > dlg.handle(self, FXSEL(SEL_COMMAND, > FXDialogBox::ID_ACCEPT), nil) > } > > Hope this helps, > > Lyle > > _______________________________________________ > fxruby-users mailing list > fxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From randomtalk at gmail.com Sat Apr 2 21:29:46 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sat Apr 2 21:24:32 2005 Subject: [fxruby-users] installation problems Message-ID: <939cf200504021829320be4ec@mail.gmail.com> hi :D i'm using linux, and i tried to install fxruby.. there seem to be some problems with config script.. the following are what reported in the shell: /usr/bin/ruby1.8 /root/FXRuby-1.2.5/ext/fox12/extconf.rb /root/FXRuby-1.2.5/ext/fox12/extconf.rb:4:in `require': no such file to load --mkmf (LoadError) from /root/FXRuby-1.2.5/ext/fox12/extconf.rb:4 config failed 'system /usr/bin/ruby1.8 /root/FXRuby-1.2.5/ext/fox12/extconf.rb ' failed Try 'ruby install.rb --help' for detailed usage. tried googling, but it's no help, anyone know what's wrong? -- www.programer.name - my own personal blog : ) From vjoel at PATH.Berkeley.EDU Sat Apr 2 21:44:33 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Sat Apr 2 21:39:35 2005 Subject: [fxruby-users] installation problems In-Reply-To: <939cf200504021829320be4ec@mail.gmail.com> References: <939cf200504021829320be4ec@mail.gmail.com> Message-ID: <424F5891.7020005@path.berkeley.edu> Jason Wang wrote: > hi :D i'm using linux, and i tried to install fxruby.. there seem to > be some problems with config script.. the following are what reported > in the shell: > /usr/bin/ruby1.8 /root/FXRuby-1.2.5/ext/fox12/extconf.rb > /root/FXRuby-1.2.5/ext/fox12/extconf.rb:4:in `require': no such file > to load --mkmf (LoadError) > from /root/FXRuby-1.2.5/ext/fox12/extconf.rb:4 > config failed > 'system /usr/bin/ruby1.8 /root/FXRuby-1.2.5/ext/fox12/extconf.rb ' failed > Try 'ruby install.rb --help' for detailed usage. > > tried googling, but it's no help, anyone know what's wrong? mkmf.rb is part of the ruby distribution (on my system it's at /usr/local/lib/ruby/1.8/mkmf.rb), so maybe there is something wrong in there. To see where ruby is looking, you can try this: /usr/bin/ruby1.8 -e 'p $LOAD_PATH' You can set the RUBYLIB env var to add paths. From randomtalk at gmail.com Sat Apr 2 22:51:46 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sat Apr 2 22:46:32 2005 Subject: [fxruby-users] installation problems In-Reply-To: <424F5891.7020005@path.berkeley.edu> References: <939cf200504021829320be4ec@mail.gmail.com> <424F5891.7020005@path.berkeley.edu> Message-ID: <939cf20050402195118aabe46@mail.gmail.com> mmm.. i'm really new to ruby.. not really sure what your talking about :| i tried typing in /usr/bin/ruby1.8 -e 'p $LOAD_PATH', it just gave me a >, assuming that's where you input ruby code? i tried searching for the file, can't find it apparently.. i'm using the latest debian package from apt get.. do you know wat's going on? -- www.programer.name - my own personal blog : ) From vjoel at PATH.Berkeley.EDU Sun Apr 3 01:19:02 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Sun Apr 3 01:14:04 2005 Subject: [fxruby-users] installation problems In-Reply-To: <939cf20050402195118aabe46@mail.gmail.com> References: <939cf200504021829320be4ec@mail.gmail.com> <424F5891.7020005@path.berkeley.edu> <939cf20050402195118aabe46@mail.gmail.com> Message-ID: <424F8AD6.9020708@path.berkeley.edu> Jason Wang wrote: > mmm.. i'm really new to ruby.. not really sure what your talking about > :| i tried typing in /usr/bin/ruby1.8 -e 'p $LOAD_PATH', it just gave > me a >, assuming that's where you input ruby code? i tried searching > for the file, can't find it apparently.. i'm using the latest debian > package from apt get.. do you know wat's going on? The > may mean that there are an odd number of single-quotes on your commmand line, so your shell is waiting for you to finish the input. Sorry, dunno much about debian packages. I have heard that the debian packagers broke ruby up into a number of packages that all have to be installed (but this may be an ugly rumor, or I may just be wrong). I usually just build from source on linux, and only bother with prepackaged ruby on windows. From randomtalk at gmail.com Sun Apr 3 11:37:49 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sun Apr 3 11:32:33 2005 Subject: [fxruby-users] installation problems In-Reply-To: <424F8AD6.9020708@path.berkeley.edu> References: <939cf200504021829320be4ec@mail.gmail.com> <424F5891.7020005@path.berkeley.edu> <939cf20050402195118aabe46@mail.gmail.com> <424F8AD6.9020708@path.berkeley.edu> Message-ID: <939cf200504030837467dc0a9@mail.gmail.com> mmm.. i use apt get mainly because it's easy to keep track of all of the upgrades and stuff :P mmm.. btw, i typed in /usr/bin/ruby1.8 -e 'p $LOAD_PATH' (correctly this time), and it outputted this: ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/i386-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/i386-linux", "."] i'll try to compile ruby from source, see if it works :| -- www.programer.name - my own personal blog : ) From randomtalk at gmail.com Sun Apr 3 11:51:38 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sun Apr 3 11:46:22 2005 Subject: [fxruby-users] installation problems In-Reply-To: <939cf200504030837467dc0a9@mail.gmail.com> References: <939cf200504021829320be4ec@mail.gmail.com> <424F5891.7020005@path.berkeley.edu> <939cf20050402195118aabe46@mail.gmail.com> <424F8AD6.9020708@path.berkeley.edu> <939cf200504030837467dc0a9@mail.gmail.com> Message-ID: <939cf200504030851392f31e4@mail.gmail.com> ok, i have just compiled and installed ruby, though, when i try installing fxruby, it gave me an error saying /usr/bin/ruby file or dir not found, prob just a hang over from the debian installation.. i now have the file:/usr/local/lib/ruby/1.8 dir and everything is in there.. how do i set the path to that folder and overwrite the original one? thanks alot :D -- www.programer.name - my own personal blog : ) From vjoel at PATH.Berkeley.EDU Sun Apr 3 16:02:47 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Sun Apr 3 15:57:49 2005 Subject: [fxruby-users] installation problems In-Reply-To: <939cf200504030837467dc0a9@mail.gmail.com> References: <939cf200504021829320be4ec@mail.gmail.com> <424F5891.7020005@path.berkeley.edu> <939cf20050402195118aabe46@mail.gmail.com> <424F8AD6.9020708@path.berkeley.edu> <939cf200504030837467dc0a9@mail.gmail.com> Message-ID: <42504BE7.7070406@path.berkeley.edu> Jason Wang wrote: > mmm.. i use apt get mainly because it's easy to keep track of all of > the upgrades and stuff :P mmm.. btw, i typed in /usr/bin/ruby1.8 -e 'p > $LOAD_PATH' (correctly this time), and it outputted this: > ["/usr/local/lib/site_ruby/1.8", > "/usr/local/lib/site_ruby/1.8/i386-linux", "/usr/local/lib/site_ruby", > "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/i386-linux", "."] Is mkmf.rb in any of those dirs? It should probably be in /usr/lib/ruby/1.8. From randomtalk at gmail.com Sun Apr 3 19:05:47 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sun Apr 3 19:00:31 2005 Subject: [fxruby-users] installation problems In-Reply-To: <42504BE7.7070406@path.berkeley.edu> References: <939cf200504021829320be4ec@mail.gmail.com> <424F5891.7020005@path.berkeley.edu> <939cf20050402195118aabe46@mail.gmail.com> <424F8AD6.9020708@path.berkeley.edu> <939cf200504030837467dc0a9@mail.gmail.com> <42504BE7.7070406@path.berkeley.edu> Message-ID: <939cf2005040316054c0874f5@mail.gmail.com> mmm.. read my later e-mails.. i installed ruby via it's source, but then, how would i point to the new ruby installation, and not the older one? thanks alot :D btw, the source installation have hte same dir and same file as you do :D -- www.programer.name - my own personal blog : ) From info at sten-net.de Tue Apr 5 08:30:15 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Tue Apr 5 08:25:00 2005 Subject: [fxruby-users] Connecting messages to methods Message-ID: <425284D7.8000608@sten-net.de> Hi all. I'm trying to write a subclass of FXMainWindow which has several methods to dispatch events. The class looks like this: -- require "fox12" require "fox12/responder" include Fox class Window < FXMainWindow include Responder ID_SELF, ID_BTN = enum(FXMainWindow::ID_LAST, 2) def initialize(a, title) super(a, title, nil, nil, DECOR_ALL, 0, 0, 640, 480) self.setSelector(ID_SELF) self.setTarget(self) self.connect(SEL_CLOSE, method(:onClose)) self.connect(SEL_COMMAND, method(:onCommand)) FXButton.new(self, "Click me!", nil, self, ID_BTN) end def create super show(PLACEMENT_SCREEN) end def onClose(sender, sel, event) getApp.exit(0) end def onCommand(sender, sel, event) # ... end end -- I'd like to redirect all SEL_COMMAND events to Window::onCommand. As an example, if one clicks the button, the message (SEL_COMMAND, ID_BTN) is sent to the Window class but is not handled there (Window::onCommand is never called). When using FXMAPFUNC(SEL_COMMAND, ID_BTN, "onCommand") or (better) FXMAPFUNCS(SEL_COMMAND, ID_SELF, ID_BTN, "onCommand") this should work but I neither want to use this C-macro style nor do I want to add .connect(SEL_COMMAND, method(:onCommand)) to each widget I append to Window (this is one of the reasons why I'm not using GTK+). Is there a way? Did I miss something? Regards, Jannis From haroldworby at earthlink.net Thu Apr 7 00:40:40 2005 From: haroldworby at earthlink.net (Harold Worby) Date: Thu Apr 7 00:35:22 2005 Subject: [fxruby-users] Retriving FXTextField Data In-Reply-To: Message-ID: Ok, here's the complete function. The paramater passed as (cell) is handle to a FXTableItem. The calling line is dlgNewTest(cell) When then button.connect uses: getApp().stopModal(dlg, true) dlg.hide I get: table.rbw:224:in `stopModal': No matching function for overloaded 'FXApp_stopModal' (ArgumentError) And when I use: dlg.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) I Get: table.rbw:227:in `dlgNewTest': undefined method `FXSEL' for # NoMethodError) I'm guessing the the issue has to to do with the scope of the dlg object? What overloaded 'FXApp_stopModal'? ##################################################### def dlgNewTest(cell) dlg = FXDialogBox.new(getApp(),"Edit Destination",DECOR_TITLE|DECOR_BORDER,0,0,0,0) outter = FXVerticalFrame.new(dlg,LAYOUT_FILL_X|LAYOUT_FILL_Y) # Contents inner = FXHorizontalFrame.new(outter,LAYOUT_FILL_X|LAYOUT_FILL_Y) labels = FXVerticalFrame.new(inner,LAYOUT_FILL_X|LAYOUT_FILL_Y) lblName=FXLabel.new(labels,"Name",nil,LABEL_NORMAL) lblPath=FXLabel.new(labels,"Pathname",nil,LABEL_NORMAL) lblSize=FXLabel.new(labels,"Size Limit",nil,LABEL_NORMAL) fields = FXVerticalFrame.new(inner,LAYOUT_FILL_X|LAYOUT_FILL_Y) txtName=FXTextField.new(fields ,20 , nil,TEXTFIELD_NORMAL) txtName.text=@table.getItemText(cell.row,1) txtPath=FXTextField.new(fields ,66 , nil,TEXTFIELD_NORMAL) txtPath.text=@table.getItemText(cell.row,2) txtSize=FXTextField.new(fields ,12 , nil,TEXTFIELD_NORMAL) txtSize.text=@table.getItemText(cell.row,3) # Separator FXHorizontalSeparator.new(outter,LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|SEPARA TOR_GROOVE) # Bottom buttons buttons=FXHorizontalFrame.new(outter) # Accept btnAccept=FXButton.new(buttons, "&Accept", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) btnAccept.connect(SEL_COMMAND){|sender, selector, data| @table.setItemText(cell.row,1,txtName.text) @table.setItemText(cell.row,2,txtPath.text) @table.setItemText(cell.row,3,txtSize.text) #getApp().stopModal(dlg, true) #dlg.hide #gives table.rbw:224:in `stopModal': No matching function for overloaded 'FXApp_stopModal' (ArgumentError) dlg.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) #gives table.rbw:227:in `dlgNewTest': undefined method `FXSEL' for # (NoMethodError) } # Cancel btnCancel=FXButton.new(buttons, "&Cancel", nil, dlg, FXDialogBox::ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) btnCancel.connect(SEL_COMMAND){|sender, selector, data| } # Delete btnDelete=FXButton.new(buttons, "&Delete", nil, dlg, FXDialogBox::ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) btnDelete.connect(SEL_COMMAND){|sender, selector, data| sql="DELETE FROM DESTINATIONS WHERE " sql=sql + " name='" + txtName.text + "'" sql=sql + " and pathname='" + txtPath.text + "'" } dlg.create dlg.execute end ##################################################### > -----Original Message----- > From: fxruby-users-bounces@rubyforge.org > [mailto:fxruby-users-bounces@rubyforge.org]On Behalf Of Lyle Johnson > Sent: Tuesday, March 29, 2005 6:19 AM > To: Harold Worby > Cc: fxruby-users@rubyforge.org > Subject: Re: [fxruby-users] Retriving FXTextField Data > > > > On Mar 28, 2005, at 10:59 PM, Harold Worby wrote: > > > Now I added the '.connect(SEL_COMMAND){' and the data is correct, but > > the > > Accept button does not dimiss the diallog 'dlg'. > > As I read the docs, FXButton.new(parent, text, icon, target, selector, > > opts,...), > > should be creating a button that will send the message > > 'selecotor'(ID_ACCEPT > > hear) to the object 'target'(dlg here). > > Yes... > > > Which is what it seemed to do before I added the .connect(SEL_COMMAND) > > {block} > > I expect it catch the SEL_COMMAND message, execute the {block} and > > then send > > the ID_ACCEPT message. Why doesn't it? > > As soon as you call connect() on the button, it replaces the previously > designated message target (the dialog box) with a new one -- an > "anonymous" target, if you like, that responds to the SEL_COMMAND > message from the button. And FOX only allows one message target object > per widget, so in this case it's the latter object (the anonymous one) > that wins. > > To accomplish what you want, I'd just write it this way: > > FXButton.new(buttons, "&Accept", nil, nil, 0, > ...).connect(SEL_COMMAND) { > @table.setItemText(cell.row,1,txtName.text) > @table.setItemText(cell.row,2,txtPath.text) > @table.setItemText(cell.row,3,txtSize.text) > getApp().stopModal(dlg, true) > dlg.hide > } > > or more directly: > > FXButton.new(buttons, "&Accept", nil, nil, 0, > ...).connect(SEL_COMMAND) { > @table.setItemText(cell.row,1,txtName.text) > @table.setItemText(cell.row,2,txtPath.text) > @table.setItemText(cell.row,3,txtSize.text) > dlg.handle(self, FXSEL(SEL_COMMAND, > FXDialogBox::ID_ACCEPT), nil) > } > > Hope this helps, > > Lyle > > _______________________________________________ > fxruby-users mailing list > fxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From lyle at knology.net Thu Apr 7 08:21:21 2005 From: lyle at knology.net (Lyle Johnson) Date: Thu Apr 7 08:15:47 2005 Subject: [fxruby-users] Retriving FXTextField Data In-Reply-To: References: Message-ID: <1802ba4baaed1edaacce6b20532300c7@knology.net> On Apr 2, 2005, at 8:16 PM, Harold Worby wrote: > Ok, here's the complete function. > The paramater passed as (cell) is handle to a FXTableItem. > The calling line is > dlgNewTest(cell) > When then button.connect uses: > getApp().stopModal(dlg, true) > dlg.hide > I get: > table.rbw:224:in `stopModal': No matching function for overloaded > 'FXApp_stopModal' (ArgumentError) Whoops, my mistake. The second argument to stopModal() should be an integer, not a boolean value. Try replacing the line: getApp().stopModal(dlg, true) with: getApp().stopModal(dlg, 1) and see what you get. > And when I use: > dlg.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) > I Get: > table.rbw:227:in `dlgNewTest': undefined method `FXSEL' for > # > NoMethodError) OK, I assumed you were using FXRuby 1.2, but you must be using FXRuby 1.0. For FXRuby 1.0, this line would need to read: dlg.handle(self, MKUINT(FXDialogBox::ID_ACCEPT, SEL_COMMAND), nil) Hope this helps, Lyle From lyle at knology.net Thu Apr 7 08:40:32 2005 From: lyle at knology.net (Lyle Johnson) Date: Thu Apr 7 08:34:55 2005 Subject: [fxruby-users] Re: FxRuby onChore animation performance problem In-Reply-To: <20050401191319.45032.qmail@web52408.mail.yahoo.com> References: <20050401191319.45032.qmail@web52408.mail.yahoo.com> Message-ID: On Apr 1, 2005, at 1:13 PM, Dmitri Sviridov wrote: > I run into a 3D graphics Animation performance > problem. The animation gets chunky. Smooth animation > path is being interrupted by pauses. This happens on > Windows, I have not tried other platforms yet. > Do have any idea how to get around this problem? Because Ruby's interpreter doesn't use native threads, we have to do some tricky things in FXRuby to make sure that Ruby threads are allowed to run alongside the FOX event loop. If your application isn't using any Ruby threads for anything, you might try disabling the aforementioned "tricky code" by calling the disableThreads() method on your application object, e.g. myApp.disableThreads Hope this helps, Lyle From lyle.johnson at gmail.com Thu Apr 7 09:08:39 2005 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Thu Apr 7 09:03:20 2005 Subject: [fxruby-users] Re: FXRuby for fox-toolkit-1.4.11? In-Reply-To: <200504062029.55282.sander@knology.net> References: <20050406201232.GA13915@freeze.org> <200504062029.55282.sander@knology.net> Message-ID: On Apr 6, 2005 10:27 PM, Sander Jansen wrote: > Does your glass ball tell you how many lunches you need have in order to > finish it? I told you guys it's gonna take more than lunch from Schlotzsky's to bribe me to get this finished. We're talking a steak dinner, at least. ;) But seriously, though: On my first pass through, I'm trying to merge in the changes to the public APIs. This basically includes old functions whose signatures have changed, new functions, removed functions, and new classes. When I compared the FOX 1.2 header files to the FOX 1.4 header files, about 150 of the 200+ header files had changed in some way, and so that gives you some idea of how much changed in the public APIs alone. I would say I'm about a third of the way through those changes. The next step, which is more tedious, is trying to figure out the subtle changes in the implementation. For example, suppose some function for the FXTable class used to delete the table items it was processing, but now it doesn't. I have to know things like that for the the garbage collection of Ruby objects to be handled properly. Or maybe some widget used to send an integer as its message data and now it sends a double-precision float. Seemingly little changes like that can be very difficult to identify, and it just takes a lot of code inspection. All that is to say that I have no idea how to estimate the time it will take to eat this elephant, I just have to do it one bite at a time. From randomtalk at gmail.com Sun Apr 10 16:31:11 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sun Apr 10 16:25:42 2005 Subject: [fxruby-users] clipboard example? In-Reply-To: <1802ba4baaed1edaacce6b20532300c7@knology.net> References: <1802ba4baaed1edaacce6b20532300c7@knology.net> Message-ID: <939cf20050410133174532206@mail.gmail.com> hi, i'm trying out the different examples included in the doc, however, i'm stuck on one example, the clip board tutorial.. on the second page, u have one code snippet: # User clicks Copy copyButton.connect(SEL_COMMAND) do customer = customerList.getItemData(customerList.currentItem) types = [ FXWindow.stringType ] if acquireClipboard(types) @clippedCustomer = customer end end where do u put that in the over all code? i tried everywhere and it doesn't work for some reason :| thanks alot :D Jason -- www.programer.name - my own personal blog : ) The mind is its own place, and in itself can make a heav'n of hell, a hell of heav'n. What matter where, if I be still the same, and what I should be, all but less than he whom thunder hath made greater? Here at least we shall be free; th' Almighty hath not built here for his envy, will not drive us hence: Here we may reign secure, and in my choice to reign is worth ambition though in hell: Better to reign in hell, than serve in heav'n. --- John Milton, in his epic poem Paradise Lost From randomtalk at gmail.com Sun Apr 10 16:39:01 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sun Apr 10 16:33:33 2005 Subject: [fxruby-users] clipboard example? In-Reply-To: <939cf20050410133174532206@mail.gmail.com> References: <1802ba4baaed1edaacce6b20532300c7@knology.net> <939cf20050410133174532206@mail.gmail.com> Message-ID: <939cf2005041013391065df04@mail.gmail.com> On Apr 10, 2005 4:31 PM, Jason Wang wrote: > hi, i'm trying out the different examples included in the doc, > however, i'm stuck on one example, the clip board tutorial.. on the > second page, u have one code snippet: > # User clicks Copy > copyButton.connect(SEL_COMMAND) do > customer = customerList.getItemData(customerList.currentItem) > types = [ FXWindow.stringType ] > if acquireClipboard(types) > @clippedCustomer = customer > end > end > > where do u put that in the over all code? i tried everywhere and it > doesn't work for some reason :| thanks alot :D > > Jason well, i tried to put it right under the creation of copy button.. but when i run it, and click copy button, it returns the following error: clipboard.rb:19:in `initialize': undefined local variable or method `customerList' for # (NameError) from clipboard.rb:18:in `call' from /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.2.5/lib/fox12/responder2.rb:57:in `onHandleMsg' from clipboard.rb:48:in `run' from clipboard.rb:48 from clipboard.rb:45:in `initialize' from clipboard.rb:45:in `new' from clipboard.rb:45 no idea wat's wrong :| -- www.programer.name - my own personal blog : ) From randomtalk at gmail.com Sun Apr 10 16:53:02 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sun Apr 10 16:47:32 2005 Subject: [fxruby-users] shutter.rb example wouldn't close? In-Reply-To: <939cf20050410133174532206@mail.gmail.com> References: <1802ba4baaed1edaacce6b20532300c7@knology.net> <939cf20050410133174532206@mail.gmail.com> Message-ID: <939cf200504101353536a73ff@mail.gmail.com> hi, just wondering.. the app is running fine as long as i don't click on other application.. even when i try to close it, it just freezes, i can't close it, the close button hte top right doesn't work at all.. if i click that, i can't go back to the application again.. can someone tell me why it freezes? Jason -- www.programer.name - my own personal blog : ) From randomtalk at gmail.com Sun Apr 10 17:01:31 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sun Apr 10 16:56:01 2005 Subject: [fxruby-users] shutter.rb example wouldn't close? In-Reply-To: <939cf200504101353536a73ff@mail.gmail.com> References: <1802ba4baaed1edaacce6b20532300c7@knology.net> <939cf20050410133174532206@mail.gmail.com> <939cf200504101353536a73ff@mail.gmail.com> Message-ID: <939cf2005041014014b28b93d@mail.gmail.com> On Apr 10, 2005 4:53 PM, Jason Wang wrote: > hi, just wondering.. the app is running fine as long as i don't click > on other application.. even when i try to close it, it just freezes, i > can't close it, the close button hte top right doesn't work at all.. > if i click that, i can't go back to the application again.. can > someone tell me why it freezes? > > Jason > -- > www.programer.name - my own personal blog : ) > apparently you have to go to file and quit.. why do we have to do that? is that overriding the close button or something? thanks alot :D -- www.programer.name - my own personal blog : ) From lyle at knology.net Sun Apr 10 22:00:35 2005 From: lyle at knology.net (Lyle Johnson) Date: Sun Apr 10 21:54:48 2005 Subject: [fxruby-users] clipboard example? In-Reply-To: <939cf2005041013391065df04@mail.gmail.com> References: <1802ba4baaed1edaacce6b20532300c7@knology.net> <939cf20050410133174532206@mail.gmail.com> <939cf2005041013391065df04@mail.gmail.com> Message-ID: <6a7aa3bbbc406362a9aaaf8f95581e5b@knology.net> On Apr 10, 2005, at 3:39 PM, Jason Wang wrote: > well, i tried to put it right under the creation of copy button.. but > when i run it, and click copy button, it returns the following error: > clipboard.rb:19:in `initialize': undefined local variable or method > `customerList' for # (NameError) > from clipboard.rb:18:in `call' > from > /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.2.5/lib/fox12/ > responder2.rb:57:in > `onHandleMsg' > from clipboard.rb:48:in `run' > from clipboard.rb:48 > from clipboard.rb:45:in `initialize' > from clipboard.rb:45:in `new' > from clipboard.rb:45 > > no idea wat's wrong :| Look at the code sample that appears directly under the heading "Acquiring the Clipboard" in the clipboard tutorial. You should see that toward the end of the ClipMainWindow#initialize method it creates a new FXList widget and assigns that to the customerList variable. So you'll need to connect this SEL_COMMAND handler for the copy button at some point in the code below that assignment, e.g. customerList = FXList.new(...) $customers.each { |customer| ... } copyButton.connect(SEL_COMMAND) { ... } Hope this helps, Lyle From lyle at knology.net Sun Apr 10 22:06:43 2005 From: lyle at knology.net (Lyle Johnson) Date: Sun Apr 10 22:00:55 2005 Subject: [fxruby-users] shutter.rb example wouldn't close? In-Reply-To: <939cf2005041014014b28b93d@mail.gmail.com> References: <1802ba4baaed1edaacce6b20532300c7@knology.net> <939cf20050410133174532206@mail.gmail.com> <939cf200504101353536a73ff@mail.gmail.com> <939cf2005041014014b28b93d@mail.gmail.com> Message-ID: On Apr 10, 2005, at 4:01 PM, Jason Wang wrote: > apparently you have to go to file and quit.. why do we have to do > that? is that overriding the close button or something? thanks alot :D I can't reproduce this problem on my PowerBook. Would like to hear if anyone else is seeing this problem... From polyergic at gmail.com Mon Apr 11 12:27:29 2005 From: polyergic at gmail.com (Shad Sterling) Date: Mon Apr 11 12:21:58 2005 Subject: [fxruby-users] shutter.rb example wouldn't close? In-Reply-To: References: <1802ba4baaed1edaacce6b20532300c7@knology.net> <939cf20050410133174532206@mail.gmail.com> <939cf200504101353536a73ff@mail.gmail.com> <939cf2005041014014b28b93d@mail.gmail.com> Message-ID: <4ff84b9905041109275729e487@mail.gmail.com> On Apr 10, 2005 10:06 PM, Lyle Johnson wrote: > > On Apr 10, 2005, at 4:01 PM, Jason Wang wrote: > > > apparently you have to go to file and quit.. why do we have to do > > that? is that overriding the close button or something? thanks alot :D > > I can't reproduce this problem on my PowerBook. Would like to hear if > anyone else is seeing this problem... > I've had this problem running FreeRIDE on Windows. -- ---------- Please do not send personal (non-list-related) mail to this address. Personal mail should be sent to polyergic@sterfish.com. From laurent at moldus.org Mon Apr 11 12:34:26 2005 From: laurent at moldus.org (Laurent Julliard) Date: Mon Apr 11 12:28:56 2005 Subject: [fxruby-users] Re: FXRuby for fox-toolkit-1.4.11? In-Reply-To: References: <20050406201232.GA13915@freeze.org> <200504062029.55282.sander@knology.net> Message-ID: <425AA712.2080400@moldus.org> Just speculating here but would it make sense to skip over FXruby 1.4 and target 1.6 instead? Laurent From jeroen at fox-toolkit.org Mon Apr 11 15:31:32 2005 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Mon Apr 11 15:26:01 2005 Subject: [fxruby-users] Re: FXRuby for fox-toolkit-1.4.11? In-Reply-To: <425AA712.2080400@moldus.org> References: <20050406201232.GA13915@freeze.org> <425AA712.2080400@moldus.org> Message-ID: <200504111431.32135.jeroen@fox-toolkit.org> On Monday 11 April 2005 11:34 am, Laurent Julliard wrote: > Just speculating here but would it make sense to skip over FXruby 1.4 > and target 1.6 instead? Of course, ultimately this will be completely up to Lyle.... However, I can see a few things: 1. FOX 1.6 will do almost all stuff with utf8, and software which uses FOX will need to be aware of this; at least, all software that currently goes beyond ascii will need some updating. 2. Since it will likely take an appreciable amount of time for software to catch up with FOX 1.6, I do plan to keep FOX 1.4 around on maintainance status for quite some time. [the latest bug-update was yesterday!]. 3. FOX 1.4 is *very* solid code, and I highly recommend everyone to update to this version, especially for mission-critical work; it has some very nice additions, for example the new toolbar docking stuff, editable tables, thumbnail icon viewing, and so on. 4. While 1.6 is on a very tight schedule, it isn't out yet, and since the introduction of unicode made some api's a bit fluid, I don't think Lyle should work against it until it starts to solidify into a 1.6; its liable to be a lot of work to stay up-to-date. 5. I already owe Lyle lunch [or was it steak dinner?] and I'm afraid the tab's going to run a even higher with 1.6 ;-) ;-) Regards, - Jeroen From lyle at knology.net Mon Apr 11 19:51:10 2005 From: lyle at knology.net (Lyle Johnson) Date: Mon Apr 11 19:45:18 2005 Subject: [fxruby-users] Re: FXRuby for fox-toolkit-1.4.11? In-Reply-To: <425AA712.2080400@moldus.org> References: <20050406201232.GA13915@freeze.org> <200504062029.55282.sander@knology.net> <425AA712.2080400@moldus.org> Message-ID: On Apr 11, 2005, at 11:34 AM, Laurent Julliard wrote: > Just speculating here but would it make sense to skip over FXruby 1.4 > and target 1.6 instead? I suspect that the first release of FXRuby 1.4 will occur sometime within the next two months; hopefully sooner rather than later, but that's about as close an estimate I can provide at this point. It is impossible for me to estimate when FXRuby 1.6 might be available, because there is of course no schedule for when FOX 1.6 will be released. This is part of the problem with what's happened on FXRuby 1.4; I didn't get any advance "warning" (so to speak) that FOX 1.4 was about to be released and found out about that when everyone else did, so it caught me off guard. From sander at knology.net Mon Apr 11 20:02:46 2005 From: sander at knology.net (Sander Jansen) Date: Mon Apr 11 19:53:56 2005 Subject: [fxruby-users] Re: FXRuby for fox-toolkit-1.4.11? In-Reply-To: References: <20050406201232.GA13915@freeze.org> <425AA712.2080400@moldus.org> Message-ID: <200504111702.47122.sander@knology.net> Hmmm you should have lunch with us more often :P On Monday 11 April 2005 16:51, Lyle Johnson wrote: > On Apr 11, 2005, at 11:34 AM, Laurent Julliard wrote: > > Just speculating here but would it make sense to skip over FXruby 1.4 > > and target 1.6 instead? > > I suspect that the first release of FXRuby 1.4 will occur sometime > within the next two months; hopefully sooner rather than later, but > that's about as close an estimate I can provide at this point. > > It is impossible for me to estimate when FXRuby 1.6 might be available, > because there is of course no schedule for when FOX 1.6 will be > released. This is part of the problem with what's happened on FXRuby > 1.4; I didn't get any advance "warning" (so to speak) that FOX 1.4 was > about to be released and found out about that when everyone else did, > so it caught me off guard. > > _______________________________________________ > fxruby-users mailing list > fxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users From info at sten-net.de Tue Apr 12 17:56:49 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Tue Apr 12 17:51:22 2005 Subject: [fxruby-users] FXSettings problem Message-ID: <425C4421.3070605@sten-net.de> Hi all. I tried to subclass FXSettings in order to add some functionality to it but I ran into the following problem. The code which shall be executed looks like this: def test reg = Registry.new("test.reg") reg.Parse end The Registry class basically looks this way: require "fox12" include Fox class Registry < FXSettings attr_accessor :mFile attr_accessor :mDefaults def initialize(aFile) self.mFile = aFile self.mDefaults = FXSettings.new end def Parse parseFile(self.mFile, true) Defaults(false) end def Write unparseFile(self.mFile) end def Defaults(aOverwrite) end // Then a lot of stuff for setting default values and // some model-view implementations follow but they aren't of // of importance regarding the error. end When I call reg.Parse now, the ruby interpreter prints out ./Registry.rb:26:in `parseFile': This FXSettings * already released (RuntimeError) Does anyone see my - or FXRuby's - mistake? Regards, Jannis From lyle at knology.net Tue Apr 12 18:36:04 2005 From: lyle at knology.net (Lyle Johnson) Date: Tue Apr 12 18:30:36 2005 Subject: [fxruby-users] FXSettings problem In-Reply-To: <425C4421.3070605@sten-net.de> References: <425C4421.3070605@sten-net.de> Message-ID: On Apr 12, 2005, at 4:56 PM, Jannis Pohlmann wrote: > When I call reg.Parse now, the ruby interpreter prints out > ./Registry.rb:26:in `parseFile': This FXSettings * already > released (RuntimeError) > > Does anyone see my - or FXRuby's - mistake? Yes; you need to call the base class initialize() method in your subclass' initialize() method, e.g. class Registry < FXSettings def initialize(aFile) super() self.mFile = aFile self.mDefaults = FXSettings.new end end Hope this helps, Lyle From info at sten-net.de Tue Apr 12 19:01:45 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Tue Apr 12 18:56:13 2005 Subject: [fxruby-users] FXSettings problem In-Reply-To: References: <425C4421.3070605@sten-net.de> Message-ID: <425C5359.6000502@sten-net.de> Lyle Johnson schrieb: > > On Apr 12, 2005, at 4:56 PM, Jannis Pohlmann wrote: > >> When I call reg.Parse now, the ruby interpreter prints out >> ./Registry.rb:26:in `parseFile': This FXSettings * already >> released (RuntimeError) >> >> Does anyone see my - or FXRuby's - mistake? > > > Yes; you need to call the base class initialize() method in your > subclass' initialize() method, e.g. > > class Registry < FXSettings > def initialize(aFile) > super() > self.mFile = aFile > self.mDefaults = FXSettings.new > end > end > > Hope this helps, > > Lyle ... Thanks very much, what a stupid mistake! Regards, Jannis (still banging his head against the table) From randomtalk at gmail.com Tue Apr 12 20:06:51 2005 From: randomtalk at gmail.com (Jason Wang) Date: Tue Apr 12 20:01:19 2005 Subject: [fxruby-users] some learning confusions -> shutter program customization Message-ID: <939cf20050412170617ab6e0c@mail.gmail.com> hi, i have just recently been able to download FXRuby and play around with it a little bit.. my experience with GUI programming is sadly limited to Java's swing/awt packages, and i have about 1 year of experience in java GUI programming.. now i'm in the process of familizing with it and try my hands at customizing the shutter example program.. i have several questions: first of all, how is Java's GUI stuff different? mmm.. some shutter specific (or beginner) questions.. How would you go about creating one seperate GUI for each page the shutter brings up? like i want to put a in a calender for the calender page, some boxes and buttons for submitting forms for tasks and etc.. what would be the common idiom for creating such GUI groups? since in Java you would just create a panel and stuff everything in then stuff the panel back into the frame.. mmm.. that's about all i want to ask.. thanks alot :D -- www.programer.name - my own personal blog : ) From info at sten-net.de Wed Apr 13 06:34:26 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Wed Apr 13 06:28:56 2005 Subject: [fxruby-users] Undefined method FXSettings#data Message-ID: <425CF5B2.8020504@sten-net.de> Hi Lyle. I recognized a bug in the current version of FXRuby. Trying to access the sections of a FXSettings object the following error was raised: ... undefined method `data' for # (NoMethodError) Due to this, FXSettings#each_section doesn't work, too. Regards, Jannis From lyle at knology.net Wed Apr 13 08:54:22 2005 From: lyle at knology.net (Lyle Johnson) Date: Wed Apr 13 08:48:48 2005 Subject: [fxruby-users] Undefined method FXSettings#data In-Reply-To: <425CF5B2.8020504@sten-net.de> References: <425CF5B2.8020504@sten-net.de> Message-ID: On Apr 13, 2005, at 5:34 AM, Jannis Pohlmann wrote: > Trying to access the sections of a FXSettings object the following > error was raised: > > ... undefined method `data' for # > (NoMethodError) > > Due to this, FXSettings#each_section doesn't work, too. OK, I have added this one to the bug list and it should get fixed in FXRuby 1.2.6. From sander at knology.net Wed Apr 13 20:11:50 2005 From: sander at knology.net (Sander Jansen) Date: Wed Apr 13 20:02:09 2005 Subject: [fxruby-users] some learning confusions -> shutter program customization In-Reply-To: <939cf20050412170617ab6e0c@mail.gmail.com> References: <939cf20050412170617ab6e0c@mail.gmail.com> Message-ID: <200504131711.50822.sander@knology.net> On Tuesday 12 April 2005 17:06, Jason Wang wrote: > hi, i have just recently been able to download FXRuby and play around > with it a little bit.. my experience with GUI programming is sadly > limited to Java's swing/awt packages, and i have about 1 year of > experience in java GUI programming.. now i'm in the process of > familizing with it and try my hands at customizing the shutter example > program.. i have several questions: > > first of all, how is Java's GUI stuff different? I can't answer that. Never worked with Java. > > mmm.. some shutter specific (or beginner) questions.. > How would you go about creating one seperate GUI for each page the > shutter brings up? like i want to put a in a calender for the calender > page, some boxes and buttons for submitting forms for tasks and etc.. > what would be the common idiom for creating such GUI groups? since in > Java you would just create a panel and stuff everything in then stuff > the panel back into the frame.. Assuming you want all of the GUI's created at once, as opposed to creating it dynamically, you can use the FXSwitcher layout manager to accomplish this. "The Switcher layout manager places its children exactly on top of each other; it ignores most of the layout hints provided by each child. You typically use a layout manager like the switcher to save screen real-estate, by placing for example several control panels on top of each other, and bringing the right one on top depending on the context." So create a switcher, add x many Frames in there, fill each frame up with the desired controls and connect the shutteritems somehow to the switcher to make it switch the right frame. Hope this helps, Sander > > mmm.. that's about all i want to ask.. thanks alot :D From lyle at knology.net Sat Apr 16 13:26:47 2005 From: lyle at knology.net (Lyle Johnson) Date: Sat Apr 16 13:21:08 2005 Subject: [fxruby-users] [ANN] FXRuby 1.2.6 Now Available Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 All, FXRuby version 1.2.6 is now available for download from this page: http://rubyforge.org/frs/?group_id=300&release_id=2002 The code is provided as a Win32 installer or a binary Gem (both compatible with the latest One-Click Installer for Ruby 1.8.2), as a source gem, and as a source tarball. For instructions on compiling FXRuby from source, please see: http://www.fxruby.org/doc/build.html For a summary of the changes in this release, please see this page: http://www.fxruby.org/doc/changes.html As always, the FXRuby home page is here: http://www.fxruby.org Enjoy, Lyle -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFCYUrXFXV/hD6oMd0RAviSAKCeQVMr8bI+LM+NWUL7wzYLMHiJ3gCgl+cC GSb/tjPQvzBvhp9yXapoTQw= =szzr -----END PGP SIGNATURE----- From lyle at knology.net Sat Apr 16 20:46:30 2005 From: lyle at knology.net (lyle@knology.net) Date: Sat Apr 16 20:40:49 2005 Subject: [fxruby-users] Re: [fxruby-announce] [ANN] FXRuby 1.2.6 Now Available In-Reply-To: <> References: <> Message-ID: <20050417004630.17657.qmail@webmail3.knology.net> On Sat, 16 Apr 2005 22:36:17 +0200, meinrad recheis wrote : > how can the actual fxruby version be retrieved at runtime? The result of the Fox.fxruby_version module method is a string containing the FXRuby version number: $ ruby -rfox12 -e 'puts Fox.fxruby_version' 1.2.6 Hope this helps, Lyle From colotechpro at yahoo.com Wed Apr 20 00:09:39 2005 From: colotechpro at yahoo.com (John Reed) Date: Wed Apr 20 00:03:54 2005 Subject: [fxruby-users] FXDataTarget issue Fox 1.2.6 Message-ID: <20050420040940.64167.qmail@web14521.mail.yahoo.com> FXRuby question to mailing list 4-19-05 I upgraded from Fox 1.0 to Fox 1.2, and the problem I’m having is getting my radio buttons to work with the new FXDataTarget. I just installed the new 1.2.6 FXRuby gem. Here are the details of my system: OS: XP Professional ruby 1.8.2 (2004-12-25) [i386-mswin32] *** LOCAL GEMS *** fxruby (1.2.6, 1.2.2) FXRuby is the Ruby binding to the FOX GUI toolkit. My application will correctly save and retrieve the radio button data from my database, MySQL, but once the initialize routine runs, the button is set to –1, no choice. When the display comes up, I can see the radio button is set to the correct value from the database, and then it slowly goes blank. I’ve looked at the upgrade and API documentation. Conceptually, I understand why this happens but I can’t figure out what I need to do. Here are some code snippets: def initialize .. . . sexDataTarget = FXDataTarget.new(-1) @sxmrdb = FXRadioButton.new(sexgrp, "Male", sexDataTarget, FXDataTarget::ID_OPTION, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP) @sxfrdb = FXRadioButton.new(sexgrp, "Female", sexDataTarget, FXDataTarget::ID_OPTION+1, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP) . . def dbtofields . . if @male == "X" @sxmrdb.checkState = true end if @female == "X" @sxfrdb.checkState = true end . The code to call the routines clearfields dbtofields(query) showEntryDialog Thanks for your help, John Reed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20050419/95206fd8/attachment.htm From davidp at touringcyclist.com Fri Apr 22 00:49:29 2005 From: davidp at touringcyclist.com (David Peoples) Date: Fri Apr 22 00:43:48 2005 Subject: [fxruby-users] Draw on top of a widget? Message-ID: <42688259.40709@touringcyclist.com> Is there a way to draw an arbitrary text string "on top of" an FXRuby widget, in this case an FXListBox? I want to overwrite a portion of the text in the selection box with that same text but drawn as if "selected". Can this be done in FXRuby? What am I trying to do? I'm making a version of the FXListBox widget with a keyboard interface. As you type characters, the first item in the list that matches the typed character(s) is selected. I have the key capturing and list matching routine down, and the correct item is getting displayed in the selection box. But I want to visually indicate what portion of that item has matched the typed text, and thus I want to draw just a portion of the item in the "selected" state. Since the selection box portion of the FXListBox widget is an FXButton under the skin in Fox and FXButtons don't have any way to display partial selection like say an FXTextField would, I don't see any way to do this directly in the FXListBox itself. Thus my idea of this "draw on top" kludge. I know a much cleaner approach would be to make a Fox FXButton widget that implements and displays subselection of the caption, make a new Fox "MyFXListBox" that uses that altered FXButton, all in C++, and make the glue code that imports that new widget into FXRuby. But my C++ is really weak, and I don't know thing one about SWIG. If it turns out that the "draw on top" kludge can't work, I'd appreciate seeing the source for any custom Fox C++ widgets that have been merged into FXRuby, or at least pointers for getting started with SWIG. Thanks for your time. David Peoples From info at sten-net.de Fri Apr 22 07:12:44 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Fri Apr 22 07:06:59 2005 Subject: [fxruby-users] Draw on top of a widget? In-Reply-To: <42688259.40709@touringcyclist.com> References: <42688259.40709@touringcyclist.com> Message-ID: <4268DC2C.7080707@sten-net.de> David Peoples schrieb: > Is there a way to draw an arbitrary text string "on top of" an FXRuby > widget, in this case an FXListBox? I want to overwrite a portion of > the text in the selection box with that same text but drawn as if > "selected". Can this be done in FXRuby? > > What am I trying to do? I'm making a version of the FXListBox widget > with a keyboard interface. As you type characters, the first item in > the list that matches the typed character(s) is selected. I have the > key capturing and list matching routine down, and the correct item is > getting displayed in the selection box. But I want to visually > indicate what portion of that item has matched the typed text, and > thus I want to draw just a portion of the item in the "selected" > state. Since the selection box portion of the FXListBox widget is an > FXButton under the skin in Fox and FXButtons don't have any way to > display partial selection like say an FXTextField would, I don't see > any way to do this directly in the FXListBox itself. Thus my idea of > this "draw on top" kludge. > > I know a much cleaner approach would be to make a Fox FXButton widget > that implements and displays subselection of the caption, make a new > Fox "MyFXListBox" that uses that altered FXButton, all in C++, and > make the glue code that imports that new widget into FXRuby. But my > C++ is really weak, and I don't know thing one about SWIG. If it turns > out that the "draw on top" kludge can't work, I'd appreciate seeing > the source for any custom Fox C++ widgets that have been merged into > FXRuby, or at least pointers for getting started with SWIG. > > Thanks for your time. > > David Peoples Hi. That's very simple. Subclass the widget you want to draw upon and overload onPaint(sender, sel, event) this way: def onPaint(sender, sel, event) super // Draws the widget dc = FXDCWindow.new(self, event) font = FXFont.new(getApp, "Verdana", 10) // whatever you like font.create dc.font = font dc.drawText(event.rect.x, event.rect.y, "Hello World") // choords have to be changed if you don't want to draw in the upper left corner end Maybe you will have to add Responder functionality to your widget: class MyList include Responder def initialize(...) FXMAPFUNC(SEL_PAINT, 0, "onPaint") end ... end Is this what you wanted to do? Regards, Jannis From info at sten-net.de Fri Apr 22 14:24:59 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Fri Apr 22 14:19:16 2005 Subject: [fxruby-users] Re: [Foxgui-users][beginner] [ruby] connect problem In-Reply-To: <42690E5B.20102@gmx.net> References: <4268FFF9.4020104@gmx.net> <4269082F.30202@sten-net.de> <42690E5B.20102@gmx.net> Message-ID: <4269417B.2060509@sten-net.de> Daniel W. schrieb: > Jannis Pohlmann wrote: > >> Daniel W. schrieb: >> >>> Hi, >>> >>> I'm new to FOX and first I try to use it in ruby (using rubyfx). >>> >>> I have a simple and small file in which a Tabbook and a Tabitem was >>> created. >>> In this item I create a label and I wanna catch the >>> SEL_LEFTBUTTONPRESS message >>> for it. >>> >>> Here is the source. >>> >>> @tab1 = FXTabItem.new(@tabbook, "&Standard", nil) >>> tab1frame = FXHorizontalFrame.new(@tabbook, >>> FRAME_THICK|FRAME_RAISED) >>> FXLabel.new(tab1frame, "just testing", nil, >>> FRAME_RAISED).setBackColor(@col_bg_widget) { |w| >>> w.connect(SEL_LEFTBUTTONPRESS) { >>> print "Hit\n" >>> } >>> } >>> >>> It don't works (and I've played a lot to try it). >>> Does a Label don't get the message or what's wrong? >>> >>> greetings, >>> daniel >> >> >> >> Hi. >> >> If it doesn't work with FXLabel try to use FXButton with FRAME_NONE. >> It's better since a button >> is concepted for this case (action-on-click). >> >> Regards, >> Jannis > > > > Now it works. > The 'setBackColor' doesn't return the Button object. > > I have to > w = create button > w.setBackColor > w.connect... > > Now it works, > > thank you! > daniel > Ah, yes, I had overseen that. Of course only the constructor returns the FXlabel instance, not the setBackColor() method. - Jannis From richard.lyman at gmail.com Sat Apr 23 15:27:20 2005 From: richard.lyman at gmail.com (me lyman) Date: Sat Apr 23 15:21:27 2005 Subject: [fxruby-users] Available layout options? Message-ID: <86e62e67050423122720e64d26@mail.gmail.com> How can I dynamically figure out all of the available layout options for any given widget. I can scrape the RDocs for options available to just that widget, but each widget inherits more from the hierarchy - right? -Rich From lyle at knology.net Sat Apr 23 18:34:48 2005 From: lyle at knology.net (Lyle Johnson) Date: Sat Apr 23 18:28:56 2005 Subject: [fxruby-users] Available layout options? In-Reply-To: <86e62e67050423122720e64d26@mail.gmail.com> References: <86e62e67050423122720e64d26@mail.gmail.com> Message-ID: On Apr 23, 2005, at 2:27 PM, me lyman wrote: > How can I dynamically figure out all of the available layout options > for any given widget. > > I can scrape the RDocs for options available to just that widget, but > each widget inherits more from the hierarchy - right? Well, if by "dynamically figure out" you mean some sort of method you can call on an object at runtime, there's no way to do that; you definitely have to consult the documentation. You are correct that the options (layout and otherwise) available for a particular widget include all of the options available for objects of its ancestor classes. For example, a label (an instance of the FXLabel class) has certain label-specific options (e.g. how the text is justified inside the label, or how the label's text is positioned relative to the label's icon), but since FXLabel is a subclass of FXFrame, you also have the frame decoration options at your disposal (e.g. sunken or raised frames, frame thickness, etc.) From lyle at knology.net Sun Apr 24 14:41:33 2005 From: lyle at knology.net (Lyle Johnson) Date: Sun Apr 24 14:35:46 2005 Subject: [fxruby-users] Available layout options? In-Reply-To: <86e62e6705042319252f591f53@mail.gmail.com> References: <86e62e67050423122720e64d26@mail.gmail.com> <86e62e6705042319252f591f53@mail.gmail.com> Message-ID: <2e1034015596d16e1bfc5fd8d06dc2fa@knology.net> On Apr 23, 2005, at 9:25 PM, Richard Lyman wrote: > Maybe this will get me to where I'm going: > How can I figure out the inheritance chain? > > I'm guessing that the only thing available for 1.2 is here: > http://www.fox-toolkit.org/ref12/hierarchy.html > > ... and I'm guessing that FXRuby holds to that same inheritance. Yes, the FXRuby classes' inheritance chain is the same as that for the FOX classes. > Am I guessing correctly? I can just write a script to parse that page > and derive the inheritance if FXRuby sticks to it... Sure, that should work. You might also be able to write a clever little Ruby program to figure it out for you since you can ask Ruby classes about their superclass, e.g. superclassOfLabel = Fox::FXLabel.superclass # should return Fox::FXFrame Anyways, hope this helps, Lyle From jacdx at jacobhanson.com Sun Apr 24 20:04:19 2005 From: jacdx at jacobhanson.com (Jacob Hanson) Date: Sun Apr 24 19:58:32 2005 Subject: [fxruby-users] Working hotkeys example (FXAccelTable)? In-Reply-To: <2e1034015596d16e1bfc5fd8d06dc2fa@knology.net> References: <86e62e67050423122720e64d26@mail.gmail.com> <86e62e6705042319252f591f53@mail.gmail.com> <2e1034015596d16e1bfc5fd8d06dc2fa@knology.net> Message-ID: <361655923.20050424180419@jacobhanson.com> Hello list, I'm having trouble getting hotkeys to work in FXRuby. For my app, or at least a window, can I define a global hotkey for it so that I could ,say, press F5 and run some function? I've messed with FXAccelTable and looked all over the place, but I still can't get them to work. Anyone have a working example? Thanks. See ya, -- _/ _/ _/ Jacob Hanson _/ _/_/_/ mailto:jacdx@jacobhanson.com _/_/_/ _/ _/ http://www.jacobhanson.com From lyle at knology.net Sun Apr 24 22:53:49 2005 From: lyle at knology.net (Lyle Johnson) Date: Sun Apr 24 22:47:57 2005 Subject: [fxruby-users] Working hotkeys example (FXAccelTable)? In-Reply-To: <361655923.20050424180419@jacobhanson.com> References: <86e62e67050423122720e64d26@mail.gmail.com> <86e62e6705042319252f591f53@mail.gmail.com> <2e1034015596d16e1bfc5fd8d06dc2fa@knology.net> <361655923.20050424180419@jacobhanson.com> Message-ID: On Apr 24, 2005, at 7:04 PM, Jacob Hanson wrote: > I'm having trouble getting hotkeys to work in FXRuby. For my app, or > at least a window, can I define a global hotkey for it so that I could > ,say, press F5 and run some function? I've messed with FXAccelTable > and looked all over the place, but I still can't get them to work. > Anyone have a working example? The datatarget.rb program in the "examples" directory of the FXRuby distribution provides one such example. Take a look around line 175: # Install an accelerator self.accelTable.addAccel(fxparseAccel("Ctl-Q"), getApp(), FXSEL(SEL_COMMAND, FXApp::ID_QUIT)) and change the text in the call to fxparseAccel() to some other accelerator key, e.g. self.accelTable.addAccel(fxparseAccel("F5"), getApp(), FXSEL(SEL_COMMAND, FXApp::ID_QUIT)) This says that when the user presses the F5 key, the accelerator table will send a message with type SEL_COMMAND and identifier FXApp::ID_QUIT to the application object (which is returned by the call to getApp). In your case you'll probably want to send some other message to some other object. Hope this helps, Lyle From davidp at touringcyclist.com Wed Apr 27 14:21:00 2005 From: davidp at touringcyclist.com (David Peoples) Date: Wed Apr 27 14:15:05 2005 Subject: [fxruby-users] FXListBox and SEL_PAINT messages? Message-ID: <426FD80C.7080101@touringcyclist.com> The documentation says the FXListBox widget sends the SEL_COMMAND and SEL_CHANGED messages. It doesn't say anything about the SEL_PAINT message, and my test code (below), if correct, shows that FXListBox doesn't send that message. Is there a way to cause that message to be sent? I'm trying to alter the way an FXListBox displays itself. David Peoples --- test code start --- #/usr/bin/env ruby # Tested on Ruby 1.8.2, FXRuby 1.2.6, Windows XP and SuSE Linux require 'fox12' include Fox class TestWindow < FXMainWindow include Responder ID_MYID = FXMainWindow::ID_LAST def initialize(app) super(app, "Generic Test", nil, nil, DECOR_ALL, 0, 0, 400, 200) contents = FXHorizontalFrame.new(self, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y|PACK_UNIFORM_WIDTH) myListBox = FXListBox.new(contents, self, ID_MYID, FRAME_SUNKEN|FRAME_THICK|LISTBOX_NORMAL|LAYOUT_FIX_WIDTH, 0, 0, 220, 0) myListBox.appendItem('An example') myListBox.appendItem('A longer example') myListBox.appendItem('Short') myListBox.numVisible = myListBox.numItems FXMAPFUNC(SEL_CHANGED, TestWindow::ID_MYID, "onChange") FXMAPFUNC(SEL_PAINT, TestWindow::ID_MYID, "onPaint") # I tested this originally using myListBox.connect(...) # then switched to the FXMAPFUNC() version in case the connect() # behind-the-scenes magic didn't handle this situation. end def create super show(PLACEMENT_SCREEN) end def onPaint(sender, sel, ptr) puts "TestWindow.onPaint called." # This never gets called. end def onChange(sender, sel, ptr) puts "TestWindow.onChange called." # This gets called as expected. end end application = FXApp.new("Generic Test", "FoxTest") TestWindow.new(application) application.create application.run --- test code end --- -- David Peoples davidp@touringcyclist.com The Touring Cyclist http://www.touringcyclist.com 11816 St. Charles Rock Road, Bridgeton, MO 63044 tel: 314-739-4648 fax: 314-739-4972 From lyle at knology.net Wed Apr 27 16:38:39 2005 From: lyle at knology.net (lyle@knology.net) Date: Wed Apr 27 16:32:40 2005 Subject: [fxruby-users] Re: [Foxgui-users][fxruby] FXDialogBox.new(self, "test").show won't work In-Reply-To: <> References: <> Message-ID: <20050427203839.12352.qmail@webmail2.knology.net> On Wed, 27 Apr 2005 22:10:56 +0200, "Daniel W." wrote : > I have just a simple class which is derived from FXMainWindow. > > If I do a > FXDialogBox.new(self, "test").show > in the create function it works (in create I do a super, show, and the > FXDialog...) OK. > I have one test menu with one menu command which posts a message to self. > and if I do the > FXDialogBox.new(self, "test").show > in the function onMsgCreateTemplate it does nothing. No error and now > dialog. Just to be clear: are you calling create() on the dialog box after you construct it in your onMsgCreateTemplate() method? If not, that's the problem. Your onMsgCreateTemplate() method should look something like this, I think: def onMsgCreateTemplate(sender, sel, ptr) dialog = FXDialogBox.new(self, "test") dialog.create dialog.show return 1 end Hope this helps, Lyle From lyle at knology.net Wed Apr 27 19:46:21 2005 From: lyle at knology.net (Lyle Johnson) Date: Wed Apr 27 19:40:16 2005 Subject: [fxruby-users] Re: FXDataTarget used with FXRadioButton In-Reply-To: <82d91caf7e9092746ec147b6b94774eb@drakealumni.net> References: <82d91caf7e9092746ec147b6b94774eb@drakealumni.net> Message-ID: <107ad6f3eb3ef63cae1c82b94dd7877d@knology.net> On Apr 27, 2005, at 6:28 PM, JDReed wrote: > I apologize for emailing you directly instead of the list. This > contains most of what I emailed to the list on 4-19. I've been pulling > what's left of my hair out trying to figure this out. No problem. Sorry I overlooked your previous message; I was out of town on business on the 19th and it probably got lost in the shuffle. > I have code in my initialize routine to set all of my radio buttons to > ?1, no choice. On a new entry, everything works fine. > > It?s when I go into a record that already exists that I have a > problem. My application will correctly save and retrieve the radio > button data from my database, MySQ.L When the display comes up, I can > see the radio button is set to the correct value from the database, > and then it slowly goes blank to the no choice (-1). The way that data targets work can sort-of be summarized like this: The only time a widget "pushes" its value back to the data target is when the user physically clicks on the widget. So merely setting the radio button's state using its checkState accessor method isn't going to update the data targets' values. In contrast, the widget is going to update its state from the data target's value whenever it (the widget) gets a SEL_UPDATE message -- and that happens whenever there's some idle time in the GUI. Based on this, and the code snippets that you showed, I'm guessing that when you open up an existing database record, you're setting the radio buttons' states directly instead of modifying the associated data target. If that's the case, you want to modify your dbtofields() method so that it's instead updating the data target values, e.g. def dbtofields sexDataTarget.value = -1 # I think? if @male == "X" sexDataTarget.value = 0 end if @female == "X" sexDataTarget.value = 1 end end ... or something along those lines. ;) Hope this helps (and let me know if it doesn't), Lyle From lyle.johnson at gmail.com Thu Apr 28 10:51:11 2005 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Thu Apr 28 10:45:10 2005 Subject: [fxruby-users] Re: innaccurate/misleading portrayal of project on rubyforge In-Reply-To: <1114697934.418030.72010@l41g2000cwc.googlegroups.com> References: <179b2bd705042411276ccc3004@mail.gmail.com> <1114697934.418030.72010@l41g2000cwc.googlegroups.com> Message-ID: On 4/28/05, Sander Jansen wrote: > Hmmm, never seen so much crap on that page, since somebody added that > nonsense about the licensing. Like anything you read on a Wiki, you have to take things with a grain of salt (sometimes, a whole shaker full). It's very clear that "Thursday" (the anonymous poster who started this thread) has a chip on his shoulder and so in order to correct the probably unintentional mistakes he saw in the description of wxRuby, he decided to throw in some intentional FUD about FOX on the Wiki (also anonymously). For anyone who's interested in the facts, please just go to the source. There's a page at the FOX Web site (see http://www.fox-toolkit.com/license.html ) that describes the FOX license in detail. It is a combination of the standard LGPL and an addendum that relaxes some of the more restrictive elements of the basic LGPL; in particular, point 2(d) of the license addendum makes it clear that "... subclassing from objects or widgets supplied by the library involves no modifications to the source code of the library itself, and does not constitute creating a modified copy based on the library." From lyle.johnson at gmail.com Sat Apr 30 21:19:24 2005 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Sat Apr 30 21:13:19 2005 Subject: [fxruby-users] Re: Fox FXProgressBar refresh issue In-Reply-To: <703b1e3b0504291058661ff0b@mail.gmail.com> References: <703b1e3b0504291058661ff0b@mail.gmail.com> Message-ID: On 4/29/05, Craig Moran wrote: > I am having a refresh issue with the FXProgressBar that I'd like to resolve. > First, I would like to state that I am not an experienced GUI programmer, > so I'd like some guidance. I am working with Fox, trying to implement a > progress bar. I've stripped the code below to what I think is the simplest > base level design. If it may be done simpler, please let me know. > > The issue is this. When I run this program and let it complete with no > interaction, it works fine. However, if I start clicking on the title bar, > it will eventually stop refreshing the application GUI. During my tests, > this will generally occur at 9% or shortly thereafter. When I have caused > the GUI to stop refreshing, the program still runs to completion, then > refreshes when the progress bar hits 100%. > > Here's what I'd like to know: > > > Am I implementing this correctly? No. ;) The basic problem is that you're calling doStuff() directly from the create() method, which means that the program never actually enters the main event loop until after doStuff() gets completely finished. That is to say, when you call create() on the application object (application.create) it indirectly calls your main window's create() method, and so the program hangs there until you eventually get through TOTAL iterations of updating the progress bar. Finally, it exits the main window's create() method, and then the application's create() method will also exit, and then we finally get around to calling the application's run() method, which is how the event loop is initiated. So, although your program kinda-sorta seems to be working, it's not structured quite right, and that's why you're seeing this weird behavior. > Is there a better way to implement this? In the doStuff def, I would > actually be performing real work. A minimal change to get this working more along the correct lines would be to perhaps put the call to doStuff() in a worker thread of some kind. In other words, you could start by changing your create() method to look like this: def create super show(PLACEMENT_SCREEN) Thread.new { doStuff } end This change will allow the create() method to proceed, and so on, but the "work" that doStuff() is simulating will begin and continue to progress. Now, as you have noted, in a real application, you'd want to be doing something more useful in that worker thread, and have some more meaningful measure of the progress towards that task's completion -- but that's obviously a pretty application-specific consideration. > Am I not making the correct calls to refresh the GUI? The call to getApp().repaint() is unnecessary, but it's not really hurting anything. You can go ahead and remove it. From lyle at knology.net Sat Apr 30 21:39:59 2005 From: lyle at knology.net (Lyle Johnson) Date: Sat Apr 30 21:33:44 2005 Subject: [fxruby-users] FXListBox and SEL_PAINT messages? In-Reply-To: <426FD80C.7080101@touringcyclist.com> References: <426FD80C.7080101@touringcyclist.com> Message-ID: On Apr 27, 2005, at 1:21 PM, David Peoples wrote: > The documentation says the FXListBox widget sends the SEL_COMMAND and > SEL_CHANGED messages. It doesn't say anything about the SEL_PAINT > message, and my test code (below), if correct, shows that FXListBox > doesn't send that message. Is there a way to cause that message to be > sent? I'm trying to alter the way an FXListBox displays itself. Well, the problem is that FXListBox is what I sometimes refer to as a composite widget: it's an FXPacker that basically houses a button to pop up an FXList. In fact, if you look at the FOX source code, you'll see that the FXListBox class doesn't even have an onPaint() method of its own; it just relies on its child widgets to paint themselves as they normally would. So the short answer is, there's not a simple way to do this. But to get to the point, what is it about the way that FXListBox displays itself that you'd like to change? Maybe there's another way to approach this problem...