From soumyanath at yahoo.com Thu Oct 2 14:05:04 2008 From: soumyanath at yahoo.com (Soumyanath Chatterjee) Date: Thu, 2 Oct 2008 11:05:04 -0700 (PDT) Subject: [fxruby-users] Set active only one window Message-ID: <848694.52754.qm@web33501.mail.mud.yahoo.com> Hi, I am new to the world of FXRuby. Please bear with me if I ask a stupid question. I am working on an application that requires user to login to use the software. Basically I wrote a simple code to create a second window that will ask for Login. After successful login the window is closed. The problem is, user can click on the original window without compliting the login. I want the original window to be there but not accesseble till user has completed the login. I could not find any clue in the documentation. Please help! -- Regards Soumya -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmelton at ball.com Thu Oct 2 14:25:41 2008 From: rmelton at ball.com (Melton, Ryan) Date: Thu, 2 Oct 2008 12:25:41 -0600 Subject: [fxruby-users] Set active only one window In-Reply-To: <848694.52754.qm@web33501.mail.mud.yahoo.com> References: <848694.52754.qm@web33501.mail.mud.yahoo.com> Message-ID: <2EC28B773AF39E47850AC45765483C2C026B2595@AEROMSG2.AERO.BALL.COM> You need to use a dialog box, or some other widget that runs modally. This will prevent interaction with any other windows. ________________________________ From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Soumyanath Chatterjee Sent: Thursday, October 02, 2008 12:05 PM To: fxruby-users at rubyforge.org Subject: [fxruby-users] Set active only one window Hi, I am new to the world of FXRuby. Please bear with me if I ask a stupid question. I am working on an application that requires user to login to use the software. Basically I wrote a simple code to create a second window that will ask for Login. After successful login the window is closed. The problem is, user can click on the original window without compliting the login. I want the original window to be there but not accesseble till user has completed the login. I could not find any clue in the documentation. Please help! -- Regards Soumya This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.konrad at lse.ac.uk Fri Oct 3 05:51:15 2008 From: v.konrad at lse.ac.uk (Vladimir Konrad) Date: Fri, 3 Oct 2008 10:51:15 +0100 Subject: [fxruby-users] Set active only one window In-Reply-To: <848694.52754.qm@web33501.mail.mud.yahoo.com> References: <848694.52754.qm@web33501.mail.mud.yahoo.com> Message-ID: <20081003105115.63296291@107.201.dyn.lse.ac.uk> One possible way to do log-in attached... Vlad Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: login-example.rb Type: application/x-ruby Size: 4428 bytes Desc: not available URL: From soumyanath at yahoo.com Sun Oct 5 02:57:28 2008 From: soumyanath at yahoo.com (Soumyanath Chatterjee) Date: Sat, 4 Oct 2008 23:57:28 -0700 (PDT) Subject: [fxruby-users] Set active only one window Message-ID: <984049.64945.qm@web33508.mail.mud.yahoo.com> Hi Vladimir, Thank you! This is just what I wanted. -- Regards Soumya ----- Original Message ---- From: Vladimir Konrad To: fxruby-users at rubyforge.org Sent: Friday, 3 October, 2008 15:21:15 Subject: Re: [fxruby-users] Set active only one window One possible way to do log-in attached... Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From angico at angico.org Tue Oct 21 15:54:40 2008 From: angico at angico.org (angico) Date: Tue, 21 Oct 2008 16:54:40 -0300 Subject: [fxruby-users] messages Message-ID: <1224618880.6940.36.camel@caipora> Hi, All. How could I send a message to a widget? Say, I want to have a modal window to be closed after a specified timeout. How could I send it a "default" ID_CANCEL or ID_ACCEPT message, in order to have it close itself and return control to its parent window? TIA, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Tue Oct 21 20:59:36 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 21 Oct 2008 19:59:36 -0500 Subject: [fxruby-users] messages In-Reply-To: <1224618880.6940.36.camel@caipora> References: <1224618880.6940.36.camel@caipora> Message-ID: On Oct 21, 2008, at 2:54 PM, angico wrote: > How could I send a message to a widget? Say, I want to have a modal > window to be closed after a specified timeout. How could I send it a > "default" ID_CANCEL or ID_ACCEPT message, in order to have it close > itself and return control to its parent window? This should do the trick: dialog.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby -------------- next part -------------- An HTML attachment was scrubbed... URL: From angico at angico.org Wed Oct 22 04:53:35 2008 From: angico at angico.org (angico) Date: Wed, 22 Oct 2008 05:53:35 -0300 Subject: [fxruby-users] messages In-Reply-To: References: <1224618880.6940.36.camel@caipora> Message-ID: <1224665615.6940.55.camel@caipora> Em Ter, 2008-10-21 ?s 19:59 -0500, Lyle Johnson escreveu: > > On Oct 21, 2008, at 2:54 PM, angico wrote: > > > How could I send a message to a widget? Say, I want to have a modal > > window to be closed after a specified timeout. How could I send it a > > "default" ID_CANCEL or ID_ACCEPT message, in order to have it close > > itself and return control to its parent window? > > > This should do the trick: > > > dialog.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) > > > Hope this helps, > > > Lyle > Hi, Lyle. Thanks for your tip, but I am afraid it didn't work. The point is that I have the following code, in my custom dialog box: def execute t = Thread.new { regressao } super end def regressao while @regressor.progress > 0 do @regressor.progress -= 1 sleep 0.05 end handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) end Here, I create a thread just before calling super, to implement a "regress" bar, shown in the dialog. I want the user to be prompted for as long as n seconds (here, 5 seconds) and, if she didn't atend to the dialog, the dialog takes a default action (in this case, the ID_ACCEPT). The thread works just fine, with the regress bar showing pretty well, but... Well, inserting the line handle(...) from your tip just made the dialog to freeze, with cpu usage hitting 100%. Program needs to be killed. I have tried to move the thread "regressao" to the main window (the parent window for the dialog), but it just doesn't get called. So, any idea on how to solve this problem? Thanks a lot, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From angico at angico.org Wed Oct 22 07:25:07 2008 From: angico at angico.org (angico) Date: Wed, 22 Oct 2008 08:25:07 -0300 Subject: [fxruby-users] messages In-Reply-To: <1224665615.6940.55.camel@caipora> References: <1224618880.6940.36.camel@caipora> <1224665615.6940.55.camel@caipora> Message-ID: <1224674707.6940.66.camel@caipora> Em Qua, 2008-10-22 ?s 05:53 -0300, angico escreveu: > Em Ter, 2008-10-21 ?s 19:59 -0500, Lyle Johnson escreveu: > > > > On Oct 21, 2008, at 2:54 PM, angico wrote: > > > > > How could I send a message to a widget? Say, I want to have a modal > > > window to be closed after a specified timeout. How could I send it a > > > "default" ID_CANCEL or ID_ACCEPT message, in order to have it close > > > itself and return control to its parent window? > > > > > > This should do the trick: > > > > > > dialog.handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) > > > > > > Hope this helps, > > > > > > Lyle > > > > Hi, Lyle. > > Thanks for your tip, but I am afraid it didn't work. > > The point is that I have the following code, in my custom dialog box: > > > def execute > t = Thread.new { regressao } > super > end > > def regressao > while @regressor.progress > 0 do > @regressor.progress -= 1 > sleep 0.05 > end > handle(self, FXSEL(SEL_COMMAND, FXDialogBox::ID_ACCEPT), nil) > end > > Well, while waiting for any more hints, I was wandering why the program was hanging, and I thought it was because the creation of the new thread was happening inside the overridden version of execute (before the call to super). So I dedided to create a new method, ini, to which I moved the line "t = Thread.new { regressao }", and which is called from the main window just before calling dialog.execute. It firstly seemed to work, but now I got a segmentation fault at exactly the line for the call to handle(...). Does anybody know what I am doing wrong? TIA, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From angico at angico.org Thu Oct 23 09:58:29 2008 From: angico at angico.org (angico) Date: Thu, 23 Oct 2008 10:58:29 -0300 Subject: [fxruby-users] messages In-Reply-To: <1224674707.6940.66.camel@caipora> References: <1224618880.6940.36.camel@caipora> <1224665615.6940.55.camel@caipora> <1224674707.6940.66.camel@caipora> Message-ID: <1224770309.6441.11.camel@caipora> Em Qua, 2008-10-22 ?s 08:25 -0300, angico escreveu: > Em Qua, 2008-10-22 ?s 05:53 -0300, angico escreveu: > Well, while waiting for any more hints, I was wandering why the program > was hanging, and I thought it was because the creation of the new thread > was happening inside the overridden version of execute (before the call > to super). > > So I dedided to create a new method, ini, to which I moved the line "t = > Thread.new { regressao }", and which is called from the main window just > before calling dialog.execute. It firstly seemed to work, but now I got > a segmentation fault at exactly the line for the call to handle(...). > > Does anybody know what I am doing wrong? > > TIA, > > -- > > angico Ok. I have solved the segmentation fault issue. Now the call to handle(...) causes the dialog box to close, but it still stays alive with its modal behavior. The only way I can get out of it is by typing Ctrl-C in the console. Then I got a message telling me: ./dialogx.rb:54:in `execute': Interrupt from ./dialogx.rb:54:in `execute' ... Why can't I get out of the modal loop via handle(...)? Isn't there a way to tell the dialog button to "simulate" a click on it, like we do it in Java, with doClick()? Is there any other way I can get out of the modal loop of execute()? Many thanks, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From lyle at lylejohnson.name Thu Oct 23 10:16:12 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 23 Oct 2008 09:16:12 -0500 Subject: [fxruby-users] messages In-Reply-To: <1224770309.6441.11.camel@caipora> References: <1224618880.6940.36.camel@caipora> <1224665615.6940.55.camel@caipora> <1224674707.6940.66.camel@caipora> <1224770309.6441.11.camel@caipora> Message-ID: <606C0E39-8B53-4062-A966-D2D59BD18846@lylejohnson.name> On Oct 23, 2008, at 8:58 AM, angico wrote: > Ok. I have solved the segmentation fault issue. Now the call to > handle(...) causes the dialog box to close, but it still stays alive > with its modal behavior. The only way I can get out of it is by typing > Ctrl-C in the console. Then I got a message telling me: > > ./dialogx.rb:54:in `execute': Interrupt > from ./dialogx.rb:54:in `execute' > ... > > Why can't I get out of the modal loop via handle(...)? Isn't there a > way > to tell the dialog button to "simulate" a click on it, like we do it > in > Java, with doClick()? Is there any other way I can get out of the > modal > loop of execute()? I don't know why sending the ID_ACCEPT or ID_CANCEL message wouldn't cancel the modal behavior, but I suppose you can just do what those handlers would do directly. Instead of calling handle() on the dialog box, do something like: getApp().stopModal(dialogBox, true) dialogBox.hide Hope this helps, Lyle From angico at angico.org Thu Oct 23 11:35:33 2008 From: angico at angico.org (angico) Date: Thu, 23 Oct 2008 12:35:33 -0300 Subject: [fxruby-users] messages In-Reply-To: <606C0E39-8B53-4062-A966-D2D59BD18846@lylejohnson.name> References: <1224618880.6940.36.camel@caipora> <1224665615.6940.55.camel@caipora> <1224674707.6940.66.camel@caipora> <1224770309.6441.11.camel@caipora> <606C0E39-8B53-4062-A966-D2D59BD18846@lylejohnson.name> Message-ID: <1224776133.6441.29.camel@caipora> Em Qui, 2008-10-23 ?s 09:16 -0500, Lyle Johnson escreveu: > On Oct 23, 2008, at 8:58 AM, angico wrote: > > I don't know why sending the ID_ACCEPT or ID_CANCEL message wouldn't > cancel the modal behavior, but I suppose you can just do what those > handlers would do directly. Instead of calling handle() on the dialog > box, do something like: > > getApp().stopModal(dialogBox, true) > dialogBox.hide > > Hope this helps, > > Lyle Well, Lyle, I'm affraid the mistery is still there. As far as I can see, the call to handle(...) is doing exactly the same as the call to hide(): it just hides the dialog box, while the modal loop keeps running. I made a call to dialog.show, after calling handle(...) and the dialog just popped up back to the screen. The call to getApp.stopModal(...) also is silently ignored (?). Just wandering: I'm using a thread, started from within the implementation of execute, just before calling super. This thread, then, runs a loop to implement a "regress" bar and once the regress bar reaches 0, I call handle(...) as the final line of this thread. Does this thread cause all this matter of misbehavior? Thanks, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From wblum at pacbell.net Mon Oct 27 02:53:54 2008 From: wblum at pacbell.net (William Blum) Date: Sun, 26 Oct 2008 23:53:54 -0700 Subject: [fxruby-users] Using BUTTON_TOOLBAR Message-ID: <95976802029A4A12A3BD7CAC82F75133@Neptune> Hi, folks. I'm trying to make a toolbar with buttons that change appearance when hovered over with the mouse. The docs on FXButton say that using BUTTON_TOOLBAR "causes the edge of the button to be raised when the cursor moves over it." What I'm getting is buttons without any frame, but they do not change appearance when the cursor moves over them. I'm running Ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] on Microsoft Windows Vista [Version 6.0.6001]. Here's my code: require 'fox16' include Fox class MainWindow < FXMainWindow def initialize(app) super(app, "Toolbar Example", :width => 485, :height => 300) tool_bar_shell = FXToolBarShell.new(self) top_dock_site = FXDockSite.new(self, :opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP) tool_bar = FXToolBar.new(top_dock_site, tool_bar_shell, :opts => PACK_UNIFORM_WIDTH|FRAME_RAISED|LAYOUT_FILL_X) new_button = FXButton.new(tool_bar, "New File", :opts => BUTTON_TOOLBAR) open_button = FXButton.new(tool_bar, "Open File", :opts => BUTTON_TOOLBAR) end def create super show(PLACEMENT_SCREEN) end end if __FILE__ == $0 FXApp.new do |app| MainWindow.new(app) app.create app.run end end Doesn't work on Vista? I'm doing something wrong? From rovshanb at gmail.com Mon Oct 27 06:19:41 2008 From: rovshanb at gmail.com (Rovshan Baghirov) Date: Mon, 27 Oct 2008 14:19:41 +0400 Subject: [fxruby-users] Using BUTTON_TOOLBAR In-Reply-To: <95976802029A4A12A3BD7CAC82F75133@Neptune> References: <95976802029A4A12A3BD7CAC82F75133@Neptune> Message-ID: <2427e580810270319ud519ef8n50cde02937632b85@mail.gmail.com> try this: :opts=>FRAME_LINE | BUTTON_TOOLBAR On Mon, Oct 27, 2008 at 10:53 AM, William Blum wrote: > Hi, folks. I'm trying to make a toolbar with buttons that change appearance > when hovered over with the mouse. The docs on FXButton say that using > BUTTON_TOOLBAR "causes the edge of the button to be raised when the cursor > moves over it." What I'm getting is buttons without any frame, but they do > not change appearance when the cursor moves over them. I'm running Ruby > 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] on Microsoft Windows Vista > [Version 6.0.6001]. Here's my code: > > require 'fox16' > include Fox > > class MainWindow < FXMainWindow > def initialize(app) > super(app, "Toolbar Example", > :width => 485, :height => 300) > tool_bar_shell = FXToolBarShell.new(self) > top_dock_site = FXDockSite.new(self, > :opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP) > tool_bar = FXToolBar.new(top_dock_site, tool_bar_shell, > :opts => PACK_UNIFORM_WIDTH|FRAME_RAISED|LAYOUT_FILL_X) > new_button = FXButton.new(tool_bar, > "New File", :opts => BUTTON_TOOLBAR) > open_button = FXButton.new(tool_bar, > "Open File", :opts => BUTTON_TOOLBAR) > end > > def create > super > show(PLACEMENT_SCREEN) > end > end > > if __FILE__ == $0 > FXApp.new do |app| > MainWindow.new(app) > app.create > app.run > end > end > > Doesn't work on Vista? I'm doing something wrong? > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chen_li3 at yahoo.com Mon Oct 27 13:53:14 2008 From: chen_li3 at yahoo.com (chen li) Date: Mon, 27 Oct 2008 10:53:14 -0700 (PDT) Subject: [fxruby-users] method call question Message-ID: <775765.89764.qm@web36803.mail.mud.yahoo.com> Hi all, I am new to FxRuby. I am learning it by studying some code samples. Now I am confused about a method call in the following script:? which class? defines method? create,?class FXApp or HelloWindow/FXMainWindow? Based on the code, class HelloWindow/FXMainWindow defines method 'create'. If this is true , the object from this class can response to the message. But here?why does an object created by a different class FXApp response to method 'create'? Thanks, Li require 'fox16' include Fox class HelloWindow < FXMainWindow ? def initialize(app) ??? super(app, "Hello, World!", :width => 200, :height => 100) ? end ? def create ??? super ??? show(PLACEMENT_SCREEN) ? end end app = FXApp.new HelloWindow.new(app) app.create app.run From toll at us.ibm.com Wed Oct 29 14:40:42 2008 From: toll at us.ibm.com (David Toll) Date: Wed, 29 Oct 2008 14:40:42 -0400 Subject: [fxruby-users] Forcing a re-paint Message-ID: I have an FXText window which I would like to force to be repainted immediately, not wait for the lazy re-paint. I have a call to repaint() for the FXText window and for the FXApp. The documentation for FXApp.repaint says "Paint all windows marked for repainting. On return all the applications windows have been painted". I take that to mean (or hope that it means) that this a synchronous call, and your program should wait for the repaint to complete. However that clearly is not the case - the window gets repainted some considerable time later. There is no documentation of a repaint method for FXText, nor for its parent FXScrollArea. FXScrollArea's parent is Object, so I am not at all sure from which class FXText gets a repaint method. Does anyone know do I force a (synchronous) repaint? Thanks. Dave ____________________________________________________________ David C. Toll, Research Staff Member, Secure Embedded Systems IBM T. J. Watson Research Center, 19 Skyline Drive, Hawthorne NY 10532 Phone: 914-784-7019 (t/l 863) Fax: 914-784-6205 (t/l 863) email: toll at us.ibm.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Wed Oct 29 16:05:52 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 29 Oct 2008 15:05:52 -0500 Subject: [fxruby-users] Forcing a re-paint In-Reply-To: References: Message-ID: <0D8BD3F8-8C7E-4D46-8141-412C9ADED779@lylejohnson.name> On Oct 29, 2008, at 1:40 PM, David Toll wrote: > I have an FXText window which I would like to force to be repainted > immediately, not wait for the lazy re-paint. > > I have a call to repaint() for the FXText window and for the FXApp. > > The documentation for FXApp.repaint says "Paint all windows marked > for repainting. On return all the applications windows have been > painted". I take that to mean (or hope that it means) that this a > synchronous call, and your program should wait for the repaint to > complete. However that clearly is not the case - the window gets > repainted some considerable time later. This question is addressed in the FAQ: http://www.fox-toolkit.org/faq.html#CLIENTSERVER I think you should be able to call update() on the FXText window (to mark it as dirty and in need of a repaint), followed by a call to FXApp#flush to immediately flush all drawing commands to the display. > There is no documentation of a repaint method for FXText, nor for > its parent FXScrollArea. FXScrollArea's parent is Object, so I am > not at all sure from which class FXText gets a repaint method. Actually, FXScrollArea's base class is FXComposite, not FXObject: http://www.fxruby.org/doc/api/classes/Fox/FXScrollArea.html Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby -------------- next part -------------- An HTML attachment was scrubbed... URL: From toll at us.ibm.com Mon Oct 27 12:16:50 2008 From: toll at us.ibm.com (David Toll) Date: Mon, 27 Oct 2008 12:16:50 -0400 Subject: [fxruby-users] Forcing a re-paint Message-ID: I have an FXText window which I would like to force to be repainted immediately, not wait for the lazy re-paint. I have a call to repaint() for the FXText window and for the FXApp. The documentation for FXApp.repaint says "Paint all windows marked for repainting. On return all the applications windows have been painted". I take that to mean (or hope that it means) that this a synchronous call, and your program should wait for the repaint to complete. However that clearly is not the case - the window gets repainted some considerable time later. There is no documentation of a repaint method for FXText, nor for its parent FXScrollArea. FXScrollArea's parent is Object, so I am not at all sure from which class FXText gets a repaint method. Does anyone know do I force a (synchronous) repaint? Thanks. Dave ____________________________________________________________ David C. Toll, Research Staff Member, Secure Embedded Systems IBM T. J. Watson Research Center, 19 Skyline Drive, Hawthorne NY 10532 Phone: 914-784-7019 (t/l 863) Fax: 914-784-6205 (t/l 863) email: toll at us.ibm.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Wed Oct 29 11:16:01 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 29 Oct 2008 10:16:01 -0500 Subject: [fxruby-users] method call question In-Reply-To: <775765.89764.qm@web36803.mail.mud.yahoo.com> References: <775765.89764.qm@web36803.mail.mud.yahoo.com> Message-ID: <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> On Oct 27, 2008, at 12:53 PM, chen li wrote: > I am new to FxRuby. I am learning it by studying some code samples. > Now I am confused about a method call in the following script: > which class defines method create, class FXApp or HelloWindow/ > FXMainWindow? Both FXApp and FXMainWindow define create() methods. In your example program, your HelloWindow class is overriding the base class version of create() defined in FXMainWindow. You also call the FXApp object's create() method later. > Based on the code, class HelloWindow/FXMainWindow defines method > 'create'. If this is true , the object from this class can response > to the message. But here why does an object created by a different > class FXApp response to method 'create'? Calling create() on the FXApp in turn leads to calls to create() on all of the application windows, including your HelloWindow instance. Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby From dwilde1 at gmail.com Wed Oct 29 06:46:29 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Wed, 29 Oct 2008 05:46:29 -0500 Subject: [fxruby-users] method call question In-Reply-To: <775765.89764.qm@web36803.mail.mud.yahoo.com> References: <775765.89764.qm@web36803.mail.mud.yahoo.com> Message-ID: On Mon, Oct 27, 2008 at 12:53 PM, chen li wrote: > Hi all, > > I am new to FxRuby. I am learning it by studying some code samples. Now I > am confused about a method call in the following script: which class > defines method create, class FXApp or HelloWindow/FXMainWindow? Based on > the code, class HelloWindow/FXMainWindow defines method 'create'. If this is > true , the object from this class can response to the message. But here why > does an object created by a different class FXApp response to method > 'create'? > Hello, Li - Any class can have its own method create. Even Object has several create methods. In your sample, both HelloWindow and FXApp have methods named create. If you look at the docs on http://www.fxruby.org/doc/api/, you will see the method create, but you can't see its source code because it's just a call to the Fox Toolkit's create in compiled C++ code. When looking at methods, if you don't see one defined, look to the next higher class in the inheritance. Sooner or later you'll find one, even if you have to go all the way up to object. Remember that the name 'create' is only a symbol referring to the function; it could have been FXApp::magicalAppPopper() and HelloWindow::magicalWindowpopper. Also note how HelloWindow makes use of 'super' to get the behavior defined in FXMainWindow and then add some trimming to it. HTH. -- :D -------------- next part -------------- An HTML attachment was scrubbed... URL: From rovshanb at gmail.com Wed Oct 29 01:28:58 2008 From: rovshanb at gmail.com (Rovshan Baghirov) Date: Wed, 29 Oct 2008 09:28:58 +0400 Subject: [fxruby-users] method call question In-Reply-To: <775765.89764.qm@web36803.mail.mud.yahoo.com> References: <775765.89764.qm@web36803.mail.mud.yahoo.com> Message-ID: <2427e580810282228m12837c5cpbb7ab1beccbd462c@mail.gmail.com> I'm also relatively new, but I understand it as follows: All the widgets in the hierarchy define (or inherit) the create method that is used to setup widget. When you call the create method on FXApp object it recursively calls this method on all the child widgets and because of this all the widgets have a chance to execute their initialization/setup logic. On Mon, Oct 27, 2008 at 9:53 PM, chen li wrote: > Hi all, > > I am new to FxRuby. I am learning it by studying some code samples. Now I > am confused about a method call in the following script: which class > defines method create, class FXApp or HelloWindow/FXMainWindow? Based on > the code, class HelloWindow/FXMainWindow defines method 'create'. If this is > true , the object from this class can response to the message. But here why > does an object created by a different class FXApp response to method > 'create'? > > Thanks, > > Li > > > > > > > require 'fox16' > > include Fox > > class HelloWindow < FXMainWindow > def initialize(app) > super(app, "Hello, World!", :width => 200, :height => 100) > end > > def create > super > show(PLACEMENT_SCREEN) > end > end > > app = FXApp.new > HelloWindow.new(app) > app.create > app.run > > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwilde1 at gmail.com Thu Oct 30 01:38:57 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Thu, 30 Oct 2008 00:38:57 -0500 Subject: [fxruby-users] method call question In-Reply-To: <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> References: <775765.89764.qm@web36803.mail.mud.yahoo.com> <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> Message-ID: > Calling create() on the FXApp in turn leads to calls to create() on all of > the application windows, including your HelloWindow instance. > > Hope this helps, > > Lyle > > Lyle, you're awesome. I thought I had Li covered but you added more good data. -- :D -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas_s at hotmail.com Thu Oct 30 05:54:21 2008 From: andreas_s at hotmail.com (Andreas S) Date: Thu, 30 Oct 2008 09:54:21 +0000 Subject: [fxruby-users] Selecting multiple table rows Message-ID: Greetings, I'm working on my first fxruby project and I'd like to be able to select multiple FXTable rows, similar to LIST_EXTENDED behavior for FXList. First of all, is there already an option to do this from FXTable or its rowHeader? Secondly, I thought I can implement this myself. I'll save the row index on left button click on row header. If the left button click is accompanied by SHIFT, then I'll select all rows between from last row index to the currently selected row. I figure I need FXEvent so I can check if SHIFT has been pressed. I can't use row header's SEL_CLICKED because the data is the row index. SEL_LEFTBUTTONRELEASE gives me an FXEvent, just what I need. But now I run into a problem. FXTable seems to define row header's SEL_LEFTBUTTONRELEASE response, which is un-pressing the row header button (or even more, I'm not sure). I lose that when I do rowHeader.connect(SEL_LEFTBUTTONRELEASE) {...}. I'd like to avoid finding out what widget defines the response, what the response behavior is and reimplementing it. How can I add a response for row header's SEL_LEFTBUTTONRELEASE, rather than redefining it? So far I'm very pleased and enjoying working with fxruby. Thank you in advance for your help. -andre _________________________________________________________________ Want to do more with Windows Live? Learn ?10 hidden secrets? from Jamie. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From chen_li3 at yahoo.com Thu Oct 30 12:30:56 2008 From: chen_li3 at yahoo.com (chen li) Date: Thu, 30 Oct 2008 09:30:56 -0700 (PDT) Subject: [fxruby-users] method call question In-Reply-To: <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> Message-ID: <815945.45345.qm@web36803.mail.mud.yahoo.com> Hi everyone, Thank all for the explanations. I read all the feedbacks,go back and read Lyle's the book about Fxruby again. Then I add some lines to find out 1) object and its corresponding class 2) class and its corresponding superclass(up to final superclass). Here are what I find: app object is created by class FXApp and its parent class is FXObject. hello object is created by class HelloWindow and its parent class is FXMainWindow. The final parent for class HelloWindow is FXObject(by repeating calling method superclass 6-7 times. I call all the parents in this chain as one of parent chain). And class FXApp never appears in the parernt chain. Here is my conclusion: 1) the relationship between class FXApp and HelloWindow/FXMainWindow is horizontal or brother/sister. Their final parent is class FXObject(whose final parent should be class Object.) The point here is that in line app.create(),app objcet REALLY receives message of create() defined by its corresponding class FXApp but not by create() defined by class HelloWindow/FXMainWindow. There is no inherence issues between class FXApp and class HelloWindow/FXMainWindow. 2) But what really happens after app.create() is excuted: it causes #create() defined by each widget to be called(HelloWindow widget in this case). This is why class HelloWindow/FXMainWindow has to define #create() in its class. This might be called window hierarchy but it is NOT class inherence in Ruby. If I understand correctly it looks like it is a design strategy for FxRuby: client object and server resource... I guess this is what Lyle mentions how Rxruby works on page 90 in chapter 7. Li From chen_li3 at yahoo.com Thu Oct 30 12:35:12 2008 From: chen_li3 at yahoo.com (chen li) Date: Thu, 30 Oct 2008 09:35:12 -0700 (PDT) Subject: [fxruby-users] method call question In-Reply-To: <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> Message-ID: <147811.48673.qm@web36804.mail.mud.yahoo.com> Hi everyone, I didn't put my modified codes in the pervious email. and here they are. Li ############# if __FILE__ == $0 FXApp.new do |app| puts "app belongs to class: #{app.class}" puts "FXApp has superclasss: #{FXApp.superclass}" puts hello=HelloWindow.new(app) puts "hello belongs to class: #{hello.class}" puts "HelloWindow has superclasss: #{HelloWindow.superclass}" app.create app.run end From toll at us.ibm.com Thu Oct 30 15:03:14 2008 From: toll at us.ibm.com (David Toll) Date: Thu, 30 Oct 2008 15:03:14 -0400 Subject: [fxruby-users] Forcing a re-paint In-Reply-To: <0D8BD3F8-8C7E-4D46-8141-412C9ADED779@lylejohnson.name> Message-ID: Lyle: Thanks for the suggestion. Unfortunately, it makes no difference. However, I think we are looking for the wrong problem. I can make it effectively make my FXRuby program perform the following, repeated 16 times: printf("hi\n") to the FXText window sleep(3) If I run this then all is well. However, if I concurrently run two copies of this program, from separate DOS-type command windows, then neither of them updates properly until both of the programs terminate the above sequence and re-enter command -input mode. I.e. it would appear that my problem is that, somehow, multiple FXRuby programs, running concurrently on the same copy of Windows, interfere with each other. I think this requires a deep understanding of how FXRuby works underneath, maybe requires an understanding of its interaction with Windows (Windows XP in this case). Thanks Dave ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- On Oct 29, 2008, at 1:40 PM, David Toll wrote: I have an FXText window which I would like to force to be repainted immediately, not wait for the lazy re-paint. I have a call to repaint() for the FXText window and for the FXApp. The documentation for FXApp.repaint says "Paint all windows marked for repainting. On return all the applications windows have been painted". I take that to mean (or hope that it means) that this a synchronous call, and your program should wait for the repaint to complete. However that clearly is not the case - the window gets repainted some considerable time later. This question is addressed in the FAQ: http://www.fox-toolkit.org/faq.html#CLIENTSERVER I think you should be able to call update() on the FXText window (to mark it as dirty and in need of a repaint), followed by a call to FXApp#flush to immediately flush all drawing commands to the display. There is no documentation of a repaint method for FXText, nor for its parent FXScrollArea. FXScrollArea's parent is Object, so I am not at all sure from which class FXText gets a repaint method. Actually, FXScrollArea's base class is FXComposite, not FXObject: http://www.fxruby.org/doc/api/classes/Fox/FXScrollArea.html Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From iheinrich at gmail.com Thu Oct 30 15:31:01 2008 From: iheinrich at gmail.com (Heinrich Beck) Date: Thu, 30 Oct 2008 15:31:01 -0400 Subject: [fxruby-users] Is this possible with FXRuby? Message-ID: Hi there! I am looking to make an app which uses Perforce's Ruby API. I'd like to make it cross platform (Mac and Windows) and make it a stand-alone app, that is, it is requires no gem installs etc... Can I do this with FXRuby? Thanks in Advance! all the best, Heinrich -------------- next part -------------- An HTML attachment was scrubbed... URL: From angico at angico.org Thu Oct 30 15:34:59 2008 From: angico at angico.org (angico) Date: Thu, 30 Oct 2008 16:34:59 -0300 Subject: [fxruby-users] getApp In-Reply-To: <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> References: <775765.89764.qm@web36803.mail.mud.yahoo.com> <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> Message-ID: <1225395299.22346.10.camel@caipora> Hi! Does anybody know where I can find the getApp method? I'm trying to call FXApp::beep when a user makes a mistake in an application, but calling getApp.beep gives me ./acc.rb:63:in `trat': undefined method `getApp' for # (NoMethodError) from op.rb:95:in `aEditor' from /usr/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/responder2.rb:55:in `call' from /usr/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/responder2.rb:55:in `onHandleMsg' from op.rb:291:in `run' from op.rb:291 from /usr/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb:267:in `old_initialize' from /usr/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb:267:in `initialize' from op.rb:287:in `new' from op.rb:287 Thanks, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Thu Oct 30 15:44:37 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 30 Oct 2008 14:44:37 -0500 Subject: [fxruby-users] Is this possible with FXRuby? In-Reply-To: References: Message-ID: <9CFA5A81-8A5C-42C0-B4FF-767E31C66BDD@lylejohnson.name> On Oct 30, 2008, at 2:31 PM, Heinrich Beck wrote: > I am looking to make an app which uses Perforce's Ruby API. > > I'd like to make it cross platform (Mac and Windows) and make it a > stand-alone app, that is, it is requires no gem installs etc... > > Can I do this with FXRuby? You can do it on Windows using a tool like exerb (http://exerb.sourceforge.jp/index.en.html ) or rubyscript2exe (http://www.erikveen.dds.nl/rubyscript2exe/). I don't know if either of those tools work on OS X; maybe someone else can chime in to confirm or deny that. Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby From lyle at lylejohnson.name Thu Oct 30 16:45:24 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 30 Oct 2008 15:45:24 -0500 Subject: [fxruby-users] getApp In-Reply-To: <1225395299.22346.10.camel@caipora> References: <775765.89764.qm@web36803.mail.mud.yahoo.com> <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> <1225395299.22346.10.camel@caipora> Message-ID: <20EC02BC-927F-4BD9-B82D-EA3E35B7CAF1@lylejohnson.name> On Oct 30, 2008, at 2:34 PM, angico wrote: > Does anybody know where I can find the getApp method? I'm trying to > call FXApp::beep when a user makes a mistake in an application, but > calling getApp.beep gives me The getApp() method is defined on the FXId class, which is way up in the class hierarchy and is an ancestor class for FXWindow and many other FXRuby classes. But you obviously need to have your hands on an instance of FXId or one of its subclasses to be able to call that method. A more general option (and what I suspect you'll need to use) is to just call the FXApp.instance method, which returns the (single) FXApp instance, e.g. FXApp.instance.beep Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby From wblum at pacbell.net Thu Oct 30 23:03:14 2008 From: wblum at pacbell.net (William Blum) Date: Thu, 30 Oct 2008 20:03:14 -0700 Subject: [fxruby-users] Using BUTTON_TOOLBAR In-Reply-To: <2427e580810270319ud519ef8n50cde02937632b85@mail.gmail.com> Message-ID: <66FBB84CE53E421CB8EA2C84C2380D14@Neptune> Thanks, Rovshan, that works just fine. I appreciate the help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From angico at angico.org Fri Oct 31 04:33:15 2008 From: angico at angico.org (angico) Date: Fri, 31 Oct 2008 05:33:15 -0300 Subject: [fxruby-users] getApp In-Reply-To: <20EC02BC-927F-4BD9-B82D-EA3E35B7CAF1@lylejohnson.name> References: <775765.89764.qm@web36803.mail.mud.yahoo.com> <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> <1225395299.22346.10.camel@caipora> <20EC02BC-927F-4BD9-B82D-EA3E35B7CAF1@lylejohnson.name> Message-ID: <1225441995.22346.21.camel@caipora> Em Qui, 2008-10-30 ?s 15:45 -0500, Lyle Johnson escreveu: > The getApp() method is defined on the FXId class, which is way up in > the class hierarchy and is an ancestor class for FXWindow and many > other FXRuby classes. But you obviously need to have your hands on an > instance of FXId or one of its subclasses to be able to call that > method. > > A more general option (and what I suspect you'll need to use) is to > just call the FXApp.instance method, which returns the (single) FXApp > instance, e.g. > > FXApp.instance.beep > > Hope this helps, > > Lyle > > --- > "FXRuby: Create Lean and Mean GUIs with Ruby" > Now available from the Pragmatic Bookshelf! > http://www.pragprog.com/titles/fxruby > > Hi, Lyle. According to the documentation on http://www.fxruby.org/doc/api/, the only methods available in FXId are: create created? destroy detach but it does have an attribute called "app". I guess when you say to use the method getApp you're really saying to use this app attribute which, as you explained here, is inherited by FXWindow. Am I right in thinking so? I'm just asking because I couldn't find ANY method named getApp neither on this documentation nor on the documentation for Ruby core. Sorry if these questions are boring, but I'm new to Ruby and FXRuby, and I want to understand it very well, in order to use it in depth. Thanks, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From lyle at lylejohnson.name Fri Oct 31 10:24:55 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Fri, 31 Oct 2008 09:24:55 -0500 Subject: [fxruby-users] getApp In-Reply-To: <1225441995.22346.21.camel@caipora> References: <775765.89764.qm@web36803.mail.mud.yahoo.com> <7DB8FD8F-799B-430B-B326-D35E16621580@lylejohnson.name> <1225395299.22346.10.camel@caipora> <20EC02BC-927F-4BD9-B82D-EA3E35B7CAF1@lylejohnson.name> <1225441995.22346.21.camel@caipora> Message-ID: On Oct 31, 2008, at 3:33 AM, angico wrote: > According to the documentation on http://www.fxruby.org/doc/api/, the > only methods available in FXId are: > > create created? destroy detach > > but it does have an attribute called "app". I guess when you say to > use > the method getApp you're really saying to use this app attribute > which, > as you explained here, is inherited by FXWindow. Am I right in > thinking > so? Yes. --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby From chen_li3 at yahoo.com Fri Oct 31 11:09:21 2008 From: chen_li3 at yahoo.com (chen li) Date: Fri, 31 Oct 2008 08:09:21 -0700 (PDT) Subject: [fxruby-users] query fxruby doc by ri Message-ID: <72447.10037.qm@web36805.mail.mud.yahoo.com> Hi all, I cannot search fxruby and its classes by ri. I wonder how to fix it. Thanks, Li