From lyle.johnson at gmail.com Tue May 8 11:53:10 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Tue, 8 May 2007 10:53:10 -0500 Subject: [fxruby-users] FXRuby - Users Guide problem In-Reply-To: <46409B96.8040701@gmx.de> References: <46409B96.8040701@gmx.de> Message-ID: On 5/8/07, Daniel Sturm wrote: > I just want to tell you that I fond a problem with the Users Guide of FXRuby. In > Chapter 4 - Basic Application[1] are some kind of hashes used to pass the > arguments to the method. This always leads me to a: "wrong argument type Hash > (expected Data) (TypeError)". When I replace it with an ordinary call, like we > all know from other languages (C++, Java, ...) than it works. Daniel, It sounds as though you're not using a recent-enough version of FXRuby. When you get a chance, please download and install the latest release (currently, 1.6.11) and then try again. Thanks, and let me know if that doesn't solve the problem. Lyle From philippe.lang at attiksystem.ch Wed May 9 01:33:13 2007 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Wed, 9 May 2007 07:33:13 +0200 Subject: [fxruby-users] Windows Mobile Message-ID: <6C0CF58A187DA5479245E0830AF84F4233799C@poweredge.attiksystem.ch> Hi, This may sound crazy, but has anyone tried running a small FXRuby (or fox directly?) application on a Windows Mobile Smartphone? Philippe From carcass.dev at gmail.com Thu May 10 00:43:59 2007 From: carcass.dev at gmail.com (dev carcass) Date: Thu, 10 May 2007 13:43:59 +0900 Subject: [fxruby-users] Can foxGUIb run on OS X? Message-ID: Hello, I'm starting to walk in the Ruby World. I would like to build graphical interfaces based on ruby scripts functinalities so I was wondering: Can foxGUIb run on OS X? I'm using OS X 10.4.9 (PPC), if not, Is there any GUI BUILDER for Ruby that can work on Mac? Thanks in advance. From meinrad.recheis at gmail.com Thu May 10 02:42:19 2007 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Thu, 10 May 2007 08:42:19 +0200 Subject: [fxruby-users] Can foxGUIb run on OS X? In-Reply-To: References: Message-ID: <43d756720705092342u399a0d39yf97470a292a95ec9@mail.gmail.com> On 5/10/07, dev carcass wrote: > Hello, I'm starting to walk in the Ruby World. I would like to build > graphical interfaces based on ruby scripts functinalities so I was > wondering: > > Can foxGUIb run on OS X? > > I'm using OS X 10.4.9 (PPC), if not, Is there any GUI BUILDER for Ruby > that can work on Mac? well there is RubyCocoa: http://rubycocoa.sourceforge.net/doc/ which allows to write native os x gui in ruby. cocoa has an Interface Builder. > > Thanks in advance. > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From carcass.dev at gmail.com Thu May 10 03:46:08 2007 From: carcass.dev at gmail.com (dev carcass) Date: Thu, 10 May 2007 16:46:08 +0900 Subject: [fxruby-users] Can foxGUIb run on OS X? Message-ID: mmmm, actually I was looking for something more "ruby pure", I don't want to deal with Cocoa. From meinrad.recheis at gmail.com Thu May 10 04:01:43 2007 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Thu, 10 May 2007 10:01:43 +0200 Subject: [fxruby-users] Can foxGUIb run on OS X? In-Reply-To: References: Message-ID: <43d756720705100101i264d0778x76eab23162811bd6@mail.gmail.com> On 5/10/07, dev carcass wrote: > mmmm, actually I was looking for something more "ruby pure", I don't > want to deal with Cocoa. btw.: there is also jruby and swing. works very well ... From philippe.lang at attiksystem.ch Fri May 11 04:55:12 2007 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Fri, 11 May 2007 10:55:12 +0200 Subject: [fxruby-users] Selections strange behaviour Message-ID: <6C0CF58A187DA5479245E0830AF84F4218CE5A@poweredge.attiksystem.ch> Hi, I've noticed a strange behaviour with textfield selections, when you loose the focus of a control. When you click on another control or when you use the TAB key, the selection is sometimes still visible, "greyed-out". Apparently, there is a selection "remanence" when you use the mouse to move from one control to another, all the time. There is also such a behaviour when you use the TAB key to go to a field that has no content. If the control you move to has content, selection disappears. I'm not sure this is a bug, but I think it is quite strange... Here is the test code: simply run the program, and press TAB, or click into textfields 2, 3 or 4. I'm using ruby186-25.exe under Windows XP, with fxruby-1.6.11-mswin32.gem. Philippe Lang ---------------------- #!/usr/bin/ruby require 'fox16' include Fox class MyWindow < FXMainWindow def initialize(app) super(app, "Window", nil, nil, DECOR_ALL, 0, 0, 300, 150) # Menu bar stretched along the top of the main window menubar = FXMenuBar.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X) # File menu filemenu = FXMenuPane.new(self) FXMenuTitle.new(menubar, "&File", nil, filemenu) FXMenuCommand.new(filemenu, "&Quit\tCtl-Q\tQuit the application", nil, app, FXApp::ID_QUIT) # Fields f = FXMatrix.new(self, 3, MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP) t1 = FXTextField.new(f, 10, nil, 0, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW) t2 = FXTextField.new(f, 10, nil, 0, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW) t3 = FXTextField.new(f, 10, nil, 0, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW) t4 = FXTextField.new(f, 10, nil, 0, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW) # Values t1.text = "123" t2.text = "456" # Selection t1.setFocus t1.selectAll end def create super show(PLACEMENT_SCREEN) end end if __FILE__ == $0 application = FXApp.new("Attik System", "FXRuby Test") MyWindow.new(application) application.create application.run end From jeroen at fox-toolkit.org Fri May 11 10:10:42 2007 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Fri, 11 May 2007 09:10:42 -0500 Subject: [fxruby-users] Selections strange behaviour In-Reply-To: <6C0CF58A187DA5479245E0830AF84F4218CE5A@poweredge.attiksystem.ch> References: <6C0CF58A187DA5479245E0830AF84F4218CE5A@poweredge.attiksystem.ch> Message-ID: <200705110910.42762.jeroen@fox-toolkit.org> On Friday 11 May 2007 03:55, Philippe Lang wrote: > Hi, > > I've noticed a strange behaviour with textfield selections, when you > loose the focus of a control. When you click on another control or when > you use the TAB key, the selection is sometimes still visible, > "greyed-out". > > Apparently, there is a selection "remanence" when you use the mouse to > move from one control to another, all the time. > There is also such a behaviour when you use the TAB key to go to a field > that has no content. If the control you move to has content, selection > disappears. > > I'm not sure this is a bug, but I think it is quite strange... It is not a bug. The selection of one text field is lost when something else gets selected. You can middle-mouse paste text from the field that has the selection into some other control (FXText or FXTextField). On X11, selection is system-wide, i.e. you can paste from FXTextField in a FOX application to something that acceptes text, possibly in another application. When focus is transferred to a FXTextField, text in the field, if there is any, is selected. The selection of the original FXTextField is lost only as a side effect of the fact that there is only one selection in the system [on Windows, we can only manage the primary selection within the application, but on X11 its system-wide]. Hope this explains, Jeroen From philippe.lang at attiksystem.ch Sat May 12 01:54:11 2007 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Sat, 12 May 2007 07:54:11 +0200 Subject: [fxruby-users] Selections strange behaviour References: <6C0CF58A187DA5479245E0830AF84F4218CE5A@poweredge.attiksystem.ch> <200705110910.42762.jeroen@fox-toolkit.org> Message-ID: <6C0CF58A187DA5479245E0830AF84F423379BF@poweredge.attiksystem.ch> Jeroen van der Zijp wrote: >> Apparently, there is a selection "remanence" when you use the mouse >> to move from one control to another, all the time. >> There is also such a behaviour when you use the TAB key to go to a >> field that has no content. If the control you move to has content, >> selection disappears. >> >> I'm not sure this is a bug, but I think it is quite strange... > > It is not a bug. > > > > You can middle-mouse paste text from the field that has the selection > into some other control (FXText or FXTextField). Thanks! I didn't know about the middle-mouse click that allows to past text. Very useful. Best regards, Philippe Lang From lyle.johnson at gmail.com Mon May 14 12:01:17 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 14 May 2007 11:01:17 -0500 Subject: [fxruby-users] FXRuby help needed In-Reply-To: <42112.134.53.7.120.1179156878.squirrel@134.53.7.120> References: <42112.134.53.7.120.1179156878.squirrel@134.53.7.120> Message-ID: On 5/14/07, kloftaj at muohio.edu wrote: > I recently downloaded the FXRuby package, but I cannot get it to work when > I try to apply it to a Ruby class. > > The lines: > "require 'fox16'" > "include Fox" > > are not working for me. The error I receive is: > > window.rb:1:in `require': No such file to load -- > /root/Desktop/tomove/ForRuby/lib/fox16 (LoadError) > from window.rb:1 > > > Do I need to put those folders within a certain eclipse folder? Right now > I have a set up of: > > where Eclipse is being stored > /opt/eclipse 3.2/ > > /root/Desktop/tomove/ForRuby/lib/fox16 > > Do I need to add fox16 to an eclipse plugin folder? Alex, I don't quite know how to answer your question, because I'm confused about what Eclipse has to do with any of this. Let's start with some basic information: When you say you downloaded the "FXRuby package", what do you mean? What was the name of the file, and where did you get it? Did you follow the installation instructions found in the Users' Guide? http://www.fxruby.org/doc/book.html What operating system are you using, and which version of Ruby? And what does Eclipse have to do with any of this? Thanks, Lyle From lyle.johnson at gmail.com Mon May 14 16:28:49 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Mon, 14 May 2007 15:28:49 -0500 Subject: [fxruby-users] FXRuby help needed In-Reply-To: <56860.134.53.7.120.1179162491.squirrel@134.53.7.120> References: <42112.134.53.7.120.1179156878.squirrel@134.53.7.120> <56860.134.53.7.120.1179162491.squirrel@134.53.7.120> Message-ID: On 5/14/07, kloftaj at muohio.edu wrote: > I did look at the user guide based on the .gem installation package > (http://www.fxruby.org/doc/gems.html), but could not get gem to work from > the terminal window. So I simply extracted the source files from the .tgz > file found within the .gem. I then proceeded to follow the Unix/Linux > install guide that you mentioned in your reply. The config worked fin but > when I tried to do the "ruby install.rb install" command from the terminal > it gave me some errors (I'll have those tomorrow because I already left > work). > > I am running mostly on Red Hat Linux Enterprise 4, along with Ruby 1.8.6. > However, I also have the option of running under WindowsXP if I so desire > (could possibly be easier to install?) Reading between the lines, it sounds like you're somewhat uncomfortable working with the command line in Linux, so yes, I think you're probably better off running it under Windows. There's a one-click installer for Ruby, which you can download here: http://rubyforge.org/projects/rubyinstaller/ and it includes FXRuby as part of its installation. So that should work out of the box. > I mentioned Eclipse because I am using Eclipse as my IDE and therefore > installed ruby through it using the Find/Install Updates option. OK. I don't know anything about how Eclipse's Ruby integration works, so I can't really help you there. From lyle.johnson at gmail.com Thu May 17 11:25:59 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Thu, 17 May 2007 10:25:59 -0500 Subject: [fxruby-users] fxruby on cygwin...so close In-Reply-To: <1179413348.489943.289740@e65g2000hsc.googlegroups.com> References: <1179413348.489943.289740@e65g2000hsc.googlegroups.com> Message-ID: On 5/17/07, bwv549 wrote: > It compiles happily, says it is install on the system: > make install > make: Nothing to be done for `install'. > > make clean There's your trouble. There was a bug in RubyGems (which has since been fixed) that caused it to immediately clobber compiled extensions ("make clean") after it finished building them. Update to the latest RubyGems and you should be good to go. From vjoel at path.berkeley.edu Thu May 17 16:07:31 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Thu, 17 May 2007 13:07:31 -0700 Subject: [fxruby-users] FXMDIChild shrinkwrap to content Message-ID: <464CB603.5060100@path.berkeley.edu> How can I get a FXMDIChild to shrinkwrap to its content? Here's what I'm doing now: def create(*) self.height = maxChildHeight + 30 self.width = maxChildWidth + 10 super end This works, but I'm not crazy about manually adjusting for (apparently) frame and title bar sizes. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From vjoel at path.berkeley.edu Sat May 19 18:03:34 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Sat, 19 May 2007 15:03:34 -0700 Subject: [fxruby-users] mdiclient windows do not always activate on click In-Reply-To: <46327584.4060502@path.berkeley.edu> References: <46327083.9040004@path.berkeley.edu> <46327584.4060502@path.berkeley.edu> Message-ID: <464F7436.7080707@path.berkeley.edu> Joel VanderWerf wrote: > Joel VanderWerf wrote: >> I just noticed that MDIClient windows do not automatically become >> current when they receive a mouse click, but only do so if the click >> happens inside of an enabled widget. This may very well be correct, but >> if so then what is the right way to handle it, if you want a more >> familiar window-manager behavior (click to focus)? >> >> For example, if you change the mditest.rb example like so... >> >> --- mditest.rb 2007-04-18 16:19:59.000000000 -0700 >> +++ mdi.rb 2007-04-27 14:44:54.000000000 -0700 >> @@ -134,7 +134,7 @@ >> scrollwindow = FXScrollWindow.new(mdichild, 0) >> scrollwindow.verticalScrollBar.setLine(@font.fontHeight) >> btn = FXButton.new(scrollwindow, TYGER, >> - :opts => LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, :width => 600, >> :height => 1000) >> + :opts => LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, :width => 100, >> :height => 100) >> btn.font = @font >> btn.backColor = FXColor::White >> mdichild >> >> >> ...and then click on the empty area within one of the windows behind the >> active child, then that window will not be made active. >> >> However, adding the line >> >> scrollwindow.enabled = true >> >> makes the behavior feel more normal (to me). >> >> Is there any drawback to enabling things like scroll windows (probably >> also frames and matrixes, but I haven't tried them)? >> >> Is there a better way to handle this? >> > > Here's a candidate. In the FXMDIChild's create method, enable the > content window (which I guess is everything but the title bar and > border), and handle mousedown: > > def create(*) > super > contentWindow.enable > contentWindow.connect(SEL_LEFTBUTTONPRESS) do > parent.setActiveChild self > false > end > end > > Unfortunately, a mouse click in (for example) a label inside of the > content window doesn't get caught this way. Still looking for something > better... And here's an update on getting click-to-focus to work in MDI land... The workaround above isn't quite right, since it enables too many windows, and the connect(SEL_LEFTBUTTONPRESS) seems to interfere with the ability of FXTable's scrollbars to scroll the table (I'm not sure why, because I do return false). Anyway, the latest workaround is: def create(*) super pr = proc do |w| case w when FXComposite, FXLabel w.enable w.connect(SEL_LEFTBUTTONPRESS) do parent.setActiveChild self self.setFocus false end end end pr[contentWindow] contentWindow.each_child_recursive do |ch| pr[ch] end end Is there a more elegant solution? My guess: The source of the problem is that I am expecting MDIClient to behave like a window manager, which would have focus policy options, like click-to-focus. Possible solutions: 1. MDIClient has a new option for focus policy, and, if CLICK_TO_FOCUS is set, then clicking in a child window sends SEL_CHANGED to the MDICLient and doesn't send the message to the child. 2. Another message, SEL_CLICK_INACTIVE or something, is sent to the MDIClient only when an inactive part of a child is clicked. The MDIClient can choose to activate the window, ignore the message, etc. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From vjoel at path.berkeley.edu Sat May 19 18:55:37 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Sat, 19 May 2007 15:55:37 -0700 Subject: [fxruby-users] table with no row headers Message-ID: <464F8069.8030208@path.berkeley.edu> Is this the right way to turn off row headers? table.rowHeaderMode = LAYOUT_FIX_WIDTH table.rowHeaderWidth = 0 -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From vjoel at path.berkeley.edu Sat May 19 21:02:41 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Sat, 19 May 2007 18:02:41 -0700 Subject: [fxruby-users] a table column that fills horizontally Message-ID: <464F9E31.6000807@path.berkeley.edu> Is there a way to specify that a table column should resize itself to fill available space, so that it is just big enough that there is no unused space in the table, but there is no horizontal scroll bar? That might be too special a situation for FXTable in general to handle, but anyway here's a way to do it (tested a little). The +fill+ variable is the column number of the column that should adjust its width. fill_resizer = proc do other_width = table.verticalScrollBar.width + table.rowHeaderWidth + (0...columns.size).inject(0){|sum,c| sum + (c == fill ? 0 : table.getColumnWidth(c))} table.setColumnWidth fill, table.width - other_width - 1 false end table.connect(SEL_CONFIGURE, &fill_resizer) table.columnHeader.connect(SEL_CHANGED, &fill_resizer) -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From lyle.johnson at gmail.com Sun May 20 18:49:32 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Sun, 20 May 2007 17:49:32 -0500 Subject: [fxruby-users] table with no row headers In-Reply-To: <464F8069.8030208@path.berkeley.edu> References: <464F8069.8030208@path.berkeley.edu> Message-ID: On 5/19/07, Joel VanderWerf wrote: > Is this the right way to turn off row headers? > > table.rowHeaderMode = LAYOUT_FIX_WIDTH > table.rowHeaderWidth = 0 What about just doing: table.rowHeader.hide ? From lyle.johnson at gmail.com Sun May 20 18:57:32 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Sun, 20 May 2007 17:57:32 -0500 Subject: [fxruby-users] a table column that fills horizontally In-Reply-To: <464F9E31.6000807@path.berkeley.edu> References: <464F9E31.6000807@path.berkeley.edu> Message-ID: On 5/19/07, Joel VanderWerf wrote: > Is there a way to specify that a table column should resize itself to > fill available space, so that it is just big enough that there is no > unused space in the table, but there is no horizontal scroll bar? No, nothing like that built in. > That might be too special a situation for FXTable in general to handle, > but anyway here's a way to do it (tested a little). The +fill+ variable > is the column number of the column that should adjust its width. Looks good! From vjoel at path.berkeley.edu Sun May 20 19:03:18 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Sun, 20 May 2007 16:03:18 -0700 Subject: [fxruby-users] a table column that fills horizontally In-Reply-To: <464F9E31.6000807@path.berkeley.edu> References: <464F9E31.6000807@path.berkeley.edu> Message-ID: <4650D3B6.5000708@path.berkeley.edu> Joel VanderWerf wrote: > Is there a way to specify that a table column should resize itself to > fill available space, so that it is just big enough that there is no > unused space in the table, but there is no horizontal scroll bar? > > That might be too special a situation for FXTable in general to handle, > but anyway here's a way to do it (tested a little). The +fill+ variable > is the column number of the column that should adjust its width. > > fill_resizer = proc do > other_width = table.verticalScrollBar.width + > table.rowHeaderWidth + > (0...columns.size).inject(0){|sum,c| sum + > (c == fill ? 0 : table.getColumnWidth(c))} > table.setColumnWidth fill, table.width - other_width - 1 > false > end > table.connect(SEL_CONFIGURE, &fill_resizer) > table.columnHeader.connect(SEL_CHANGED, &fill_resizer) > This is a slight improvement that is sensitive to whether the scroll bar is shown: fill_resizer = proc do other_width = table.rowHeaderWidth + (0...columns.size).inject(0){|sum,c| sum + (c == fill ? 0 : table.getColumnWidth(c))} vsb = table.verticalScrollBar other_width += vsb.width if vsb.shown? table.setColumnWidth fill, table.width - other_width - 1 false end table.connect(SEL_CONFIGURE, &fill_resizer) table.columnHeader.connect(SEL_CHANGED, &fill_resizer) -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From lyle.johnson at gmail.com Sun May 20 19:04:22 2007 From: lyle.johnson at gmail.com (Lyle Johnson) Date: Sun, 20 May 2007 18:04:22 -0500 Subject: [fxruby-users] FXMDIChild shrinkwrap to content In-Reply-To: <464CB603.5060100@path.berkeley.edu> References: <464CB603.5060100@path.berkeley.edu> Message-ID: On 5/17/07, Joel VanderWerf wrote: > How can I get a FXMDIChild to shrinkwrap to its content? > > Here's what I'm doing now: > > def create(*) > self.height = maxChildHeight + 30 > self.width = maxChildWidth + 10 > super > end > > This works, but I'm not crazy about manually adjusting for (apparently) > frame and title bar sizes. This is only marginally better, but I think you could instead do: self.height = defaultHeight + maxChildHeight self.width = defaultWidth + maxChildWidth The defaultHeight and defaultWidth return values should take care of the dimensions of the window's decorations (title bar, etc.) Hope this helps, Lyle From vjoel at path.berkeley.edu Sun May 20 19:08:32 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Sun, 20 May 2007 16:08:32 -0700 Subject: [fxruby-users] table with no row headers In-Reply-To: References: <464F8069.8030208@path.berkeley.edu> Message-ID: <4650D4F0.90800@path.berkeley.edu> Lyle Johnson wrote: > On 5/19/07, Joel VanderWerf wrote: > >> Is this the right way to turn off row headers? >> >> table.rowHeaderMode = LAYOUT_FIX_WIDTH >> table.rowHeaderWidth = 0 > > What about just doing: > > table.rowHeader.hide > > ? (My previous attempt to send this was rejected because it was too long, so here's one with a much smaller screenshot.) It sure looks like it should work, but it doesn't for me. --- table.rb.bck 2007-05-20 15:56:46.000000000 -0700 +++ table.rb 2007-05-20 15:56:46.000000000 -0700 @@ -82,7 +82,7 @@ @table.getItem(6, 6).justify = FXTableItem::CENTER_X|FXTableItem::CENTER_Y @table.getItem(3, 4).stipple = STIPPLE_CROSSDIAG - + @table.rowHeader.hide # File Menu filemenu = FXMenuPane.new(self) FXMenuCommand.new(filemenu, "&Quit\tCtl-Q", nil, getApp(), FXApp::ID_QUIT) This patch has a bad effect on the region of the window where the header would be: it grabs pixels from the window behind it and it stays like that. Image attached... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 -------------- next part -------------- A non-text attachment was scrubbed... Name: hide-row-header.png Type: image/png Size: 8019 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20070520/6acc093e/attachment-0001.png From vjoel at path.berkeley.edu Sun May 20 19:17:45 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Sun, 20 May 2007 16:17:45 -0700 Subject: [fxruby-users] FXMDIChild shrinkwrap to content In-Reply-To: References: <464CB603.5060100@path.berkeley.edu> Message-ID: <4650D719.7030009@path.berkeley.edu> Lyle Johnson wrote: > On 5/17/07, Joel VanderWerf wrote: > >> How can I get a FXMDIChild to shrinkwrap to its content? >> >> Here's what I'm doing now: >> >> def create(*) >> self.height = maxChildHeight + 30 >> self.width = maxChildWidth + 10 >> super >> end >> >> This works, but I'm not crazy about manually adjusting for (apparently) >> frame and title bar sizes. > > This is only marginally better, but I think you could instead do: > > self.height = defaultHeight + maxChildHeight > self.width = defaultWidth + maxChildWidth > > The defaultHeight and defaultWidth return values should take care of > the dimensions of the window's decorations (title bar, etc.) > > Hope this helps, Hm, that seems to make the window too big. Doesn't defaultWidth count the (minimum?) width of the children? So, it seems like part of the child windows are being counted twice... That might still be a good idea, though. Maybe I could call defaultWidth/defaultHeight before adding child windows, and save that away somewhere... nope. defaultWidth always seems to be too big. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From vjoel at path.berkeley.edu Sun May 20 19:00:18 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Sun, 20 May 2007 16:00:18 -0700 Subject: [fxruby-users] table with no row headers In-Reply-To: References: <464F8069.8030208@path.berkeley.edu> Message-ID: <4650D302.4080100@path.berkeley.edu> Lyle Johnson wrote: > On 5/19/07, Joel VanderWerf wrote: > >> Is this the right way to turn off row headers? >> >> table.rowHeaderMode = LAYOUT_FIX_WIDTH >> table.rowHeaderWidth = 0 > > What about just doing: > > table.rowHeader.hide > > ? It sure looks like it should work, but it doesn't for me. --- table.rb.bck 2007-05-20 15:56:46.000000000 -0700 +++ table.rb 2007-05-20 15:56:46.000000000 -0700 @@ -82,7 +82,7 @@ @table.getItem(6, 6).justify = FXTableItem::CENTER_X|FXTableItem::CENTER_Y @table.getItem(3, 4).stipple = STIPPLE_CROSSDIAG - + @table.rowHeader.hide # File Menu filemenu = FXMenuPane.new(self) FXMenuCommand.new(filemenu, "&Quit\tCtl-Q", nil, getApp(), FXApp::ID_QUIT) This patch has a bad effect on the region of the window where the header would be: it grabs pixels from the window behind it and it stays like that. Image attached... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 -------------- next part -------------- A non-text attachment was scrubbed... Name: hide-row-header.png Type: image/png Size: 56092 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20070520/e4f2d2fc/attachment-0001.png From philippe.lang at attiksystem.ch Wed May 30 01:24:48 2007 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Wed, 30 May 2007 07:24:48 +0200 Subject: [fxruby-users] Yield a message handler from another message handler? Message-ID: <6C0CF58A187DA5479245E0830AF84F42337A18@poweredge.attiksystem.ch> Hi, I'm using an FXTable as a database table interface. When clicking on a row header button, I'd like to know if the table content was changed since the last database commit. I'm using the FXTable SEL_REPLACED message for that purpose. Each time this message is fired, I raise a "diry flag" for the table. If the flag is set, the table has to be commited to the database. This works in most situations, except one: when the user is editing a cell of a fresh commited table, and then directly clicks on the row header, the table is still "non-dirty" when the FXHeader SEL_COMMAND message handler is started, and remains in this state until the message handler ends. Only then is the FXTable SEL_REPLACED message fired. But too late! Is there a way to "yield" a message handler from another one? Or is there a workaround for that problem? Thanks! Philippe Lang From philippe.lang at attiksystem.ch Wed May 30 02:18:28 2007 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Wed, 30 May 2007 08:18:28 +0200 Subject: [fxruby-users] Yield a message handler from another message handler? References: <6C0CF58A187DA5479245E0830AF84F42337A18@poweredge.attiksystem.ch> Message-ID: <6C0CF58A187DA5479245E0830AF84F42337A1A@poweredge.attiksystem.ch> fxruby-users-bounces at rubyforge.org wrote: > Hi, > > I'm using an FXTable as a database table interface. > > When clicking on a row header button, I'd like to know if the table > content was changed since the last database commit. > > I'm using the FXTable SEL_REPLACED message for that purpose. Each > time this message is fired, I raise a "diry flag" for the table. If > the flag is set, the table has to be commited to the database. > > This works in most situations, except one: when the user is editing a > cell of a fresh commited table, and then directly clicks on the row > header, the table is still "non-dirty" when the FXHeader SEL_COMMAND > message handler is started, and remains in this state until the > message handler ends. Only then is the FXTable SEL_REPLACED message > fired. But too late! > > Is there a way to "yield" a message handler from another one? Or is > there a workaround for that problem? The best workaround I found is to use the FXTable "SEL_KEYPRESS" and "SEL_DOUBLECLICKED" message for managing the dirty flag of the table. It works, but it is a bit excessive: the table is maked dirty in situations where is should not, like for example when you start editing a cell, an revert it with the ESC key. Philippe From tester.paul at gmail.com Thu May 31 16:34:17 2007 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 31 May 2007 16:34:17 -0400 Subject: [fxruby-users] How can I make a window stay open for a set amount of time? Message-ID: <37c405480705311334x3c0ff77qcf1451244115c6d7@mail.gmail.com> Hi there, I have this script that I want to go away after a few minutes. I'm new to FxRuby and don't know how to use the addTimeout() method though. Can someone please help me with this sample 'hello world' script below? ---- require 'fox14' include Fox application = FXApp.new("Hello", "FoxTest") main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL) FXButton.new(main, "&Hello, World!", nil, application, FXApp::ID_QUIT) application.create() delay = 5 * 1000 # (time is in milliseconds) application.addTimeout( delay, exit ) main.show(PLACEMENT_SCREEN) application.run() ---- I want the window to display for 5 seconds and disappear. When I run the above script nothing seems to happen though. The window never appears. Suggestions? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070531/8a59b017/attachment.html From vjoel at path.berkeley.edu Thu May 31 16:39:15 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Thu, 31 May 2007 13:39:15 -0700 Subject: [fxruby-users] How can I make a window stay open for a set amount of time? In-Reply-To: <37c405480705311334x3c0ff77qcf1451244115c6d7@mail.gmail.com> References: <37c405480705311334x3c0ff77qcf1451244115c6d7@mail.gmail.com> Message-ID: <465F3273.9090200@path.berkeley.edu> Paul Carvalho wrote: > Hi there, I have this script that I want to go away after a few > minutes. I'm new to FxRuby and don't know how to use the addTimeout() > method though. > > Can someone please help me with this sample 'hello world' script below? > > ---- > require 'fox14' > include Fox > > application = FXApp.new("Hello", "FoxTest") > main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL) > FXButton.new (main, "&Hello, World!", nil, application, FXApp::ID_QUIT) > application.create() > > delay = 5 * 1000 # (time is in milliseconds) > application.addTimeout( delay, exit ) > > main.show(PLACEMENT_SCREEN) > application.run() I tested this in 1.6, but I think it's probably the same in 1.4: application.addTimeout( delay ) { application.exit } -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From tester.paul at gmail.com Thu May 31 16:54:03 2007 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 31 May 2007 16:54:03 -0400 Subject: [fxruby-users] How can I make a window stay open for a set amount of time? In-Reply-To: <465F3273.9090200@path.berkeley.edu> References: <37c405480705311334x3c0ff77qcf1451244115c6d7@mail.gmail.com> <465F3273.9090200@path.berkeley.edu> Message-ID: <37c405480705311354t5a204af2ge5b71d1ef77f4613@mail.gmail.com> Thank you!! It works perfectly. I never would have figured that out. Cheers! Paul. =) On 31/05/07, Joel VanderWerf wrote: > > I tested this in 1.6, but I think it's probably the same in 1.4: > > application.addTimeout( delay ) { application.exit } > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070531/d305249a/attachment.html From vjoel at path.berkeley.edu Thu May 31 18:03:30 2007 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Thu, 31 May 2007 15:03:30 -0700 Subject: [fxruby-users] How can I make a window stay open for a set amount of time? In-Reply-To: <37c405480705311354t5a204af2ge5b71d1ef77f4613@mail.gmail.com> References: <37c405480705311334x3c0ff77qcf1451244115c6d7@mail.gmail.com> <465F3273.9090200@path.berkeley.edu> <37c405480705311354t5a204af2ge5b71d1ef77f4613@mail.gmail.com> Message-ID: <465F4632.3040904@path.berkeley.edu> Paul Carvalho wrote: > Thank you!! It works perfectly. I never would have figured that out. > > Cheers! Paul. =) > > On 31/05/07, *Joel VanderWerf* wrote: > > I tested this in 1.6, but I think it's probably the same in 1.4: > > application.addTimeout( delay ) { application.exit } It's a general ruby principle. If you are asking a library to execute some of your own code at a later time or after some event (i.e., a "callback"), it probably wants that code in the form of a block. Assuming the library is rubified... It never ceases to amaze me that a complex c++ library like Fox has been wrapped in a way that makes its ruby API look so natural. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407