From cribbsj at oakwood.org Tue Mar 1 14:20:33 2005 From: cribbsj at oakwood.org (Jamey Cribbs) Date: Tue Mar 1 14:16:30 2005 Subject: [fxruby-users] FXShutterItem Button Icon Message-ID: <4224C081.1010106@oakwood.org> Hi, I googled for this but did not see anything, so I'm asking here. I have an FXShutter. I'm trying to put an icon, with text below it, on each FXShutterItem. I have subclassed the FXShutterItem and, I am trying to pass TEXT_BELOW_ICON to the FXShutterItem's embedded button, but it does not appear to work. Both the icon and the text show up on the embedded button, but they are both centered and the text is centered OVER the icon instead of below it. Is this possible? Thanks! Jamey Cribbs Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments. From jeroen at fox-toolkit.org Tue Mar 1 17:31:04 2005 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Tue Mar 1 17:27:01 2005 Subject: [fxruby-users] FXShutterItem Button Icon In-Reply-To: <4224C081.1010106@oakwood.org> References: <4224C081.1010106@oakwood.org> Message-ID: <200503011631.04348.jeroen@fox-toolkit.org> On Tuesday 01 March 2005 01:20 pm, Jamey Cribbs wrote: > Hi, I googled for this but did not see anything, so I'm asking here. > > I have an FXShutter. I'm trying to put an icon, with text below it, on > each FXShutterItem. I have subclassed the FXShutterItem and, I am > trying to pass TEXT_BELOW_ICON to the FXShutterItem's embedded button, > but it does not appear to work. Both the icon and the text show up on > the embedded button, but they are both centered and the text is centered > OVER the icon instead of below it. > > Is this possible? 1) FXShutterItem allows you to access FXButton, so there should be no reason to subclass. 2) You can setIcon(), setText(), setJustify() and setIconPosition() on the button, and lay out the icon/text any way possible. Regards, - Jeoren From lyle at knology.net Tue Mar 1 21:15:39 2005 From: lyle at knology.net (Lyle Johnson) Date: Tue Mar 1 21:11:33 2005 Subject: [fxruby-users] [ANN] FXRuby 1.2.5 Now Available Message-ID: <79a70ca7d418504faa2deefba263e0de@knology.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 All, The latest version of FXRuby 1.2 is now available for download here: http://rubyforge.org/frs/?group_id=300 There have been a large number of changes for this release, including a few significant bug fixes; for a complete list, see: http://www.fxruby.org/doc/changes.html The code is provided in several formats: as a source tarball; a source Gem; a binary Gem (for Windows) based on the latest One-Click Ruby Installer (from http://rubyinstaller.rubyforge.org); and a traditional installer (like the one-click installer), also compatible with the latest One-Click Installer for Ruby. Enjoy, Lyle -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFCJSHLFXV/hD6oMd0RAmgaAJ9WZpnsaQGH8CIhR/J84vYXVaqcCACdHzXF NnQHSqPLfXoueml0BAHvlt4= =t9nn -----END PGP SIGNATURE----- From lyle at knology.net Wed Mar 2 08:42:18 2005 From: lyle at knology.net (Lyle Johnson) Date: Wed Mar 2 08:38:11 2005 Subject: [fxruby-users] FXShutterItem Button Icon In-Reply-To: <4224C081.1010106@oakwood.org> References: <4224C081.1010106@oakwood.org> Message-ID: <486823fa13218f9be641c5cbb94c49e5@knology.net> On Mar 1, 2005, at 1:20 PM, Jamey Cribbs wrote: > I have an FXShutter. I'm trying to put an icon, with text below it, > on each FXShutterItem. I have subclassed the FXShutterItem and, I am > trying to pass TEXT_BELOW_ICON to the FXShutterItem's embedded button, > but it does not appear to work. Both the icon and the text show up on > the embedded button, but they are both centered and the text is > centered OVER the icon instead of below it. > > Is this possible? As Jeroen said in his response, this should work. I just took the shutter.rb example program included with FXRuby and added a few lines right after it creates the first shutter item: shutterItem = ShutterItem.new(@shutter, "Lookout Shortcuts", nil, LAYOUT_FILL_Y) shutterItem.button.icon = redMacOS # <----- Added this shutterItem.button.iconPosition = TEXT_BELOW_ICON # <----- Added this and got the desired result. Make sure that you're setting the TEXT_BELOW_ICON option on the shutter item's button, and not on the shutter item itself. If it's still not working, please shoot me a sample program that demonstrates the problem. From cribbsj at oakwood.org Wed Mar 2 09:00:34 2005 From: cribbsj at oakwood.org (Jamey Cribbs) Date: Wed Mar 2 08:56:29 2005 Subject: [fxruby-users] FXShutterItem Button Icon In-Reply-To: <486823fa13218f9be641c5cbb94c49e5@knology.net> References: <4224C081.1010106@oakwood.org> <486823fa13218f9be641c5cbb94c49e5@knology.net> Message-ID: <4225C702.3030200@oakwood.org> Lyle Johnson wrote: > > As Jeroen said in his response, this should work. I just took the > shutter.rb example program included with FXRuby and added a few lines > right after it creates the first shutter item: > > shutterItem = ShutterItem.new(@shutter, "Lookout Shortcuts", nil, > LAYOUT_FILL_Y) > shutterItem.button.icon = redMacOS # <----- Added this > shutterItem.button.iconPosition = TEXT_BELOW_ICON # <----- Added this > Thanks Jeroen and Lyle for your responses. I used the iconPosition attribute of FXButton and it worked fine. What I was trying to use before was the buttonStyle attribute of FXButton and passing it TEXT_BELOW_ICON and that wasn't working. Thanks again! Jamey Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments. From polyergic at gmail.com Wed Mar 2 18:53:43 2005 From: polyergic at gmail.com (Shad Sterling) Date: Wed Mar 2 18:49:37 2005 Subject: [fxruby-users] Does anyone have access to an x86-64 box? In-Reply-To: <37632e249f7b44f692daa498fbccbc09@knology.net> References: <6d46356bdcf4ff81a83929488452c128@knology.net> <37632e249f7b44f692daa498fbccbc09@knology.net> Message-ID: <4ff84b9905030215532c527f1c@mail.gmail.com> I have an x86-64 machine at work I can do some with, and I couldn't get the fxruby gem to install. I've never tried to use fxruby, I suspect the problem is something really obvious that the installer isn't giving a clear error message about. [root@datastor rubygems-0.8.6]# gem install fxruby Config file /root/.gemrc does not exist Attempting local installation of 'fxruby' Local gem file not found: fxruby*.gem Attempting remote installation of 'fxruby' Updating Gem source index for: http://gems.rubyforge.org Select which gem to install for your platform (x86_64-linux) 1. fxruby 1.2.5 (mswin32) 2. fxruby 1.2.5 (ruby) 3. fxruby 1.2.4 (ruby) 4. fxruby 1.2.4 (mswin32) 5. fxruby 1.2.3 (mswin32) 6. fxruby 1.2.3 (ruby) 7. fxruby 1.2.2 (mswin32) 8. fxruby 1.2.2 (ruby) 9. fxruby 1.2.1 (ruby) 10. fxruby 1.2.1 (mswin32) 11. Cancel installation > 2 Building native extensions. This could take a while... can't find header files for ruby. ERROR: While executing gem ... (RuntimeError) ERROR: Failed to build gem native extension. Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/fxruby-1.2.5 for inspection. ruby extconf.rb install fxruby\n Results logged to /usr/lib64/ruby/gems/1.8/gems/fxruby-1.2.5/ext/fox12/gem_make.out On Sat, 26 Feb 2005 21:48:55 -0600, Lyle Johnson wrote: > > > Someone has submitted a bug report that seems to be specific to the > > x86-64 platform (running Ubuntu Linux 4.10). > > Forgot to mention: the bug report is here: > > http://rubyforge.org/tracker/?func=detail&aid=1540&group_id=300&atid=1223 > > Lyle > ---------- Please do not send personal (non-list-related) mail to this address. Personal mail should be sent to polyergic@sterfish.com. From lyle at knology.net Wed Mar 2 19:11:21 2005 From: lyle at knology.net (Lyle Johnson) Date: Wed Mar 2 19:07:11 2005 Subject: [fxruby-users] Does anyone have access to an x86-64 box? In-Reply-To: <4ff84b9905030215532c527f1c@mail.gmail.com> References: <6d46356bdcf4ff81a83929488452c128@knology.net> <37632e249f7b44f692daa498fbccbc09@knology.net> <4ff84b9905030215532c527f1c@mail.gmail.com> Message-ID: <76e1ef544f65141f0fca0b653c5a34bf@knology.net> On Mar 2, 2005, at 5:53 PM, Shad Sterling wrote: > I have an x86-64 machine at work I can do some with, and I couldn't > get the fxruby gem to install. > Results logged to > /usr/lib64/ruby/gems/1.8/gems/fxruby-1.2.5/ext/fox12/gem_make.out Could you maybe send me this file (off list)? I suppose it will tell us what went wrong. For what it's worth, the original bug report (referred to in my previous e-mail) seems to indicate that the reporter got the software built and installed, but that it just hangs up when he tries to 'require' it into Ruby. So we should at least be able to get that far. ;) From vjoel at PATH.Berkeley.EDU Thu Mar 3 14:50:31 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Thu Mar 3 14:46:28 2005 Subject: [fxruby-users] resizable table headers Message-ID: <42276A87.9080401@path.berkeley.edu> Anyone know how to make table headers resizable in 1.2? Tried this: setRowHeaderMode(0) But it just made the header very narrow, and still not resizable. What I'd really like is for it to be resizable and start with a reasonable width, even if entries are empty. From cribbsj at oakwood.org Thu Mar 3 15:03:25 2005 From: cribbsj at oakwood.org (Jamey Cribbs) Date: Thu Mar 3 14:59:18 2005 Subject: [fxruby-users] resizable table headers In-Reply-To: <42276A87.9080401@path.berkeley.edu> References: <42276A87.9080401@path.berkeley.edu> Message-ID: <42276D8D.8010502@oakwood.org> Joel VanderWerf wrote: > > Anyone know how to make table headers resizable in 1.2? > > Tried this: > > setRowHeaderMode(0) Pass TABLE_COL_SIZEABLE as one of FXTable's options. Jamey Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments. From vjoel at PATH.Berkeley.EDU Thu Mar 3 15:27:56 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Thu Mar 3 15:23:53 2005 Subject: [fxruby-users] resizable table headers In-Reply-To: <42276D8D.8010502@oakwood.org> References: <42276A87.9080401@path.berkeley.edu> <42276D8D.8010502@oakwood.org> Message-ID: <4227734C.6020306@path.berkeley.edu> Jamey Cribbs wrote: > Joel VanderWerf wrote: > >> >> Anyone know how to make table headers resizable in 1.2? >> >> Tried this: >> >> setRowHeaderMode(0) > > > Pass TABLE_COL_SIZEABLE as one of FXTable's options. I'm already doing that: super(inner_frame, 0, 0, nil, 0, TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0,0,0,0, 2,2,2,2) The rows and columns are resizable, just not the headers. IOW, I get the resize cursor between pairs of col and row headers. But not when I hover the mouse along the lines separating header from body. From lyle at knology.net Thu Mar 3 16:13:47 2005 From: lyle at knology.net (lyle@knology.net) Date: Thu Mar 3 16:09:40 2005 Subject: [fxruby-users] resizable table headers In-Reply-To: <> References: <> Message-ID: <20050303211347.11843.qmail@webmail1.knology.net> On Thu, 03 Mar 2005 12:27:56 -0800, Joel VanderWerf wrote : > The rows and columns are resizable, just not the headers. IOW, I get the > resize cursor between pairs of col and row headers. But not when I hover > the mouse along the lines separating header from body. I have not yet had an opportunity to look into this (still at work), but I wonder if it's related at all to the problem described in this thread? http://rubyforge.org/pipermail/fxruby-users/2005-February/000187.html I think it's probably a different issue -- there, David was wanting columns to *not* be resizeable. But your question reminded me of that discussion. Well, that was helpful. ;) Anyways, I'll try to check it out tonight and see what's up. Lyle From vjoel at PATH.Berkeley.EDU Thu Mar 3 18:30:15 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Thu Mar 3 18:26:16 2005 Subject: [fxruby-users] resizable table headers In-Reply-To: <20050303211347.11843.qmail@webmail1.knology.net> References: <> <20050303211347.11843.qmail@webmail1.knology.net> Message-ID: <42279E07.9000106@path.berkeley.edu> lyle@knology.net wrote: > On Thu, 03 Mar 2005 12:27:56 -0800, Joel VanderWerf > wrote : > > >>The rows and columns are resizable, just not the headers. IOW, I get the >>resize cursor between pairs of col and row headers. But not when I hover >>the mouse along the lines separating header from body. > > > I have not yet had an opportunity to look into this (still at work), but I > wonder if it's related at all to the problem described in this thread? > > http://rubyforge.org/pipermail/fxruby-users/2005-February/000187.html > > I think it's probably a different issue -- there, David was wanting columns > to *not* be resizeable. But your question reminded me of that discussion. They may be orthogonal issues. I do want the boundaries between header cells to be adjustable. But I also want the boundary between the row (not col) header widget and the table body to be movable. I'm fussy :) From lyle at knology.net Thu Mar 3 21:03:43 2005 From: lyle at knology.net (Lyle Johnson) Date: Thu Mar 3 20:59:29 2005 Subject: [fxruby-users] resizable table headers In-Reply-To: <4227734C.6020306@path.berkeley.edu> References: <42276A87.9080401@path.berkeley.edu> <42276D8D.8010502@oakwood.org> <4227734C.6020306@path.berkeley.edu> Message-ID: <3421b69ca61e71cfeeb68b02b88bab7a@knology.net> On Mar 3, 2005, at 2:27 PM, Joel VanderWerf wrote: > I'm already doing that: > > super(inner_frame, 0, 0, nil, 0, > TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, > 0,0,0,0, 2,2,2,2) Ah, I see it. You're still passing the visibleRows and visibleColumns arguments (the 2nd and 3rd arguments) to FXTable.new. Those two got dropped for FXRuby 1.2. Try this instead: super(inner_frame, nil, 0, TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0,0,0,0, 2,2,2,2) Hope this helps, Lyle From lyle at knology.net Thu Mar 3 21:08:25 2005 From: lyle at knology.net (Lyle Johnson) Date: Thu Mar 3 21:04:11 2005 Subject: [fxruby-users] Does anyone have access to an x86-64 box? In-Reply-To: <4ff84b9905030215532c527f1c@mail.gmail.com> References: <6d46356bdcf4ff81a83929488452c128@knology.net> <37632e249f7b44f692daa498fbccbc09@knology.net> <4ff84b9905030215532c527f1c@mail.gmail.com> Message-ID: On Mar 2, 2005, at 5:53 PM, Shad Sterling wrote: > I have an x86-64 machine at work I can do some with, and I couldn't > get the fxruby gem to install. > I've never tried to use fxruby, I suspect the problem is something > really obvious that the installer isn't giving a clear error message > about. > > [root@datastor rubygems-0.8.6]# gem install fxruby > Building native extensions. This could take a while... > can't find header files for ruby. Well, I should have looked at that more closely: "can't find header files for ruby". So yes, something appears to be broken in your Ruby installation before we even get around to FXRuby... From vjoel at PATH.Berkeley.EDU Fri Mar 4 00:01:10 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Thu Mar 3 23:57:16 2005 Subject: [fxruby-users] resizable table headers In-Reply-To: <3421b69ca61e71cfeeb68b02b88bab7a@knology.net> References: <42276A87.9080401@path.berkeley.edu> <42276D8D.8010502@oakwood.org> <4227734C.6020306@path.berkeley.edu> <3421b69ca61e71cfeeb68b02b88bab7a@knology.net> Message-ID: <32812.63.193.193.81.1109912470.squirrel@63.193.193.81> > > On Mar 3, 2005, at 2:27 PM, Joel VanderWerf wrote: > >> I'm already doing that: >> >> super(inner_frame, 0, 0, nil, 0, >> TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, >> 0,0,0,0, 2,2,2,2) > > Ah, I see it. You're still passing the visibleRows and visibleColumns > arguments (the 2nd and 3rd arguments) to FXTable.new. Those two got > dropped for FXRuby 1.2. Try this instead: > > super(inner_frame, nil, 0, > TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, > 0,0,0,0, 2,2,2,2) > > Hope this helps, Oops--I neglected to tell you about (or remember for that matter) that I had a "shim" file that I could use so that code would run on both 1.0 and 1.2. In that file I was defining: class FXTable alias new_1_2_api_initialize initialize def initialize(*args, &block) dim = args.slice!(1..2) new_1_2_api_initialize(*args, &block) setTableSize(*dim) end alias numCols numColumns end So I don't think those two zeros were the problem. But, for me at least, the standard table.rb example has the same problem (can't change size of headers) and it uses @table = FXTable.new(frame, nil, 0, TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0,0,0,0, 2,2,2,2) Even adding @table.setRowHeaderMode(0) doesn't help. From lyle at knology.net Fri Mar 4 07:32:55 2005 From: lyle at knology.net (Lyle Johnson) Date: Fri Mar 4 07:28:41 2005 Subject: [fxruby-users] resizable table headers In-Reply-To: <32812.63.193.193.81.1109912470.squirrel@63.193.193.81> References: <42276A87.9080401@path.berkeley.edu> <42276D8D.8010502@oakwood.org> <4227734C.6020306@path.berkeley.edu> <3421b69ca61e71cfeeb68b02b88bab7a@knology.net> <32812.63.193.193.81.1109912470.squirrel@63.193.193.81> Message-ID: On Mar 3, 2005, at 11:01 PM, Joel VanderWerf wrote: > Oops--I neglected to tell you about (or remember for that matter) that > I > had a "shim" file that I could use so that code would run on both 1.0 > and > 1.2. In that file I was defining: Ah, OK. > But, for me at least, the standard table.rb example has the same > problem > (can't change size of headers) and it uses > > @table = FXTable.new(frame, nil, 0, > TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, > 0,0,0,0, 2,2,2,2) > > Even adding > > @table.setRowHeaderMode(0) > > doesn't help. The light bulb just went on for me as to what you're wanting to do, and I don't think that FOX supports that. Looking at the FOX source code, it appears that the mouse motion handling when you're clicking and dragging inside an FXHeader is constrained to one axis, depending on how the header is oriented. If it's a horizontally-oriented header (like the column header), you can only interactively resize the widths of the different header items (but not their heights). If it's a vertically-oriented header (like the table's row header), you can only resize the heights of the header items (but not their widths). From vjoel at PATH.Berkeley.EDU Fri Mar 4 15:18:38 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Fri Mar 4 15:14:30 2005 Subject: [fxruby-users] resizable table headers In-Reply-To: References: <42276A87.9080401@path.berkeley.edu> <42276D8D.8010502@oakwood.org> <4227734C.6020306@path.berkeley.edu> <3421b69ca61e71cfeeb68b02b88bab7a@knology.net> <32812.63.193.193.81.1109912470.squirrel@63.193.193.81> Message-ID: <33138.64.169.89.77.1109967518.squirrel@64.169.89.77> Lyle Johnson wrote: > > On Mar 3, 2005, at 11:01 PM, Joel VanderWerf wrote: > >> Oops--I neglected to tell you about (or remember for that matter) that I >> had a "shim" file that I could use so that code would run on both 1.0 and >> 1.2. In that file I was defining: > > > Ah, OK. > >> But, for me at least, the standard table.rb example has the same problem >> (can't change size of headers) and it uses >> >> @table = FXTable.new(frame, nil, 0, >> TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, >> 0,0,0,0, 2,2,2,2) >> >> Even adding >> >> @table.setRowHeaderMode(0) >> >> doesn't help. > > > The light bulb just went on for me as to what you're wanting to do, and > I don't think that FOX supports that. Looking at the FOX source code, it > appears that the mouse motion handling when you're clicking and dragging > inside an FXHeader is constrained to one axis, depending on how the > header is oriented. If it's a horizontally-oriented header (like the > column header), you can only interactively resize the widths of the > different header items (but not their heights). If it's a > vertically-oriented header (like the table's row header), you can only > resize the heights of the header items (but not their widths). Darn. I guess I'm remembering the 1.0 style leading rows. Jeroen, if you're listening, is this(*) a feature that we can expect eventually? Not that it's critical, but in my case users enter text that is used for the headers, and I'd like for them to be able to see as much of it as they want. (*) Mouse control of the boundary between header and body of a table. From vjoel at PATH.Berkeley.EDU Mon Mar 7 20:57:51 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Mon Mar 7 20:53:44 2005 Subject: [fxruby-users] two table bugs Message-ID: <422D069F.9010808@path.berkeley.edu> The following two problems occur on Windows and Linux, with ruby-1.8.2 and FXRuby-1.2.5. Instead of FXTableItems, (some of) the items of a table are FXHeaderItems. A memory problem (all I know is GC.disable seems to prevent it). The code is below. ---- require "fox12" include Fox class MyTable < FXTable def initialize parent super(parent, nil, 0, TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y) fill end def fill setTableSize(100, 100) each_row_header_item do |item| item.setJustify FXHeaderItem::CENTER_Y end each_col_header_item do |item| item.setJustify FXHeaderItem::CENTER_X end each_row_index do |r| each_col_index do |c| item = table_item(r,c) item.setJustify FXTableItem::JUSTIFY_CENTER_X if item.class != Fox::FXTableItem p ["fill", r,c,item.class] end end end setCurrentItem(0,0) columnHeader.update rowHeader.update update end def each_row_index (0...numRows).each do |r| yield r end end def each_col_index (0...numColumns).each do |c| yield c end end def each_row_header_item each_row_index do |r| yield row_header_item(r) end end def each_col_header_item each_col_index do |c| yield col_header_item(c) end end def row_header_item(row) rowHeader.getItem(row) end def col_header_item(col) columnHeader.getItem(col) end def table_item(row, col) # getItem(row, col) || create_item(row, col) if (item = getItem(row, col)) if item.class != Fox::FXTableItem p ["getItem", row,col,item.class] end else item = create_item(row, col) end item end def create_item(row, col) setItemText(row, col, "") item = getItem(row, col) if item.class != Fox::FXTableItem p ["create_item", row,col,item.class] end item end end class TestWindow < FXMainWindow def initialize(app) super(app, "MyTest", nil, nil, DECOR_ALL, 0, 0, 600, 400, 0, 0) mainFrame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) bugButton = FXButton.new(mainFrame, "Bug") bugButton.connect(SEL_COMMAND) { @table.fill } @table = MyTable.new(mainFrame) end def create super show(PLACEMENT_SCREEN) end end def runme application = FXApp.new("MyTest", "FoxTest") TestWindow.new(application) application.create application.run end runme From vjoel at PATH.Berkeley.EDU Tue Mar 8 00:49:49 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Tue Mar 8 00:45:42 2005 Subject: [fxruby-users] [ANN] FoxTails 0.4 Message-ID: <422D3CFD.6070800@path.berkeley.edu> http://raa.ruby-lang.org/project/foxtails/ FoxTails-0.4 now supports Fox/FXRuby 1.2. Otherwise, not much has changed. Still alpha quality, few docs, etc. (What is FoxTails? FoxTails is a set of pure Ruby extensions for FXRuby. The most useful part of FoxTails is the use of observable attributes to connect GUI components, as an alternative to directly using Fox?s target mechanism. It helps you separate your Ruby object model from the GUI representation.) You'll need to upgrade to observable-0.4 to use FoxTails-0.4: http://raa.ruby-lang.org/project/observable/ From vjoel at PATH.Berkeley.EDU Tue Mar 8 03:16:34 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Tue Mar 8 03:12:27 2005 Subject: [fxruby-users] two table bugs In-Reply-To: <422D069F.9010808@path.berkeley.edu> References: <422D069F.9010808@path.berkeley.edu> Message-ID: <422D5F62.8010705@path.berkeley.edu> Joel VanderWerf wrote: > > The following two problems occur on Windows and Linux, with ruby-1.8.2 > and FXRuby-1.2.5. > > Instead of FXTableItems, (some of) the items of a table are FXHeaderItems. Odd. Some debugging code shows that FXTable#createItem sometimes returns a FXHeaderItem. On linux there's usually one of these per 100x100 table, as I fill it with items. On windows there seem to be more. From lyle at knology.net Tue Mar 8 07:21:15 2005 From: lyle at knology.net (Lyle Johnson) Date: Tue Mar 8 07:16:46 2005 Subject: [fxruby-users] Re: [Foxgui-users]FXRuby: 1.4? In-Reply-To: <1043197683.20050307221206@jacobhanson.com> References: <2d51e2b10503071947106fbbb7@mail.gmail.com> <1043197683.20050307221206@jacobhanson.com> Message-ID: <0562473ab6f4a96af933e791aeaba64b@knology.net> On Mar 7, 2005, at 11:12 PM, Jacob Hanson wrote: > I'm using FXRuby and I like it quite a bit. But I've been hitting > barriers that Fox1.4 would provide for, but Fox1.2 doesn't (new > controls, new features, etc). Is FXRuby 1.4 coming soon? I remember > hearing 1.3 was going to be skipped due to large API changes. But what > about 1.4? I'd love to use it and I'm sure the Ruby community would > enthusiastically embrace it as well. I can't promise a release date for FXRuby 1.4, but work has begun on it. From lyle at knology.net Tue Mar 8 07:27:42 2005 From: lyle at knology.net (Lyle Johnson) Date: Tue Mar 8 07:23:14 2005 Subject: [fxruby-users] two table bugs In-Reply-To: <422D069F.9010808@path.berkeley.edu> References: <422D069F.9010808@path.berkeley.edu> Message-ID: On Mar 7, 2005, at 7:57 PM, Joel VanderWerf wrote: > > The following two problems occur on Windows and Linux, with ruby-1.8.2 > and FXRuby-1.2.5. > > Instead of FXTableItems, (some of) the items of a table are > FXHeaderItems. > > A memory problem (all I know is GC.disable seems to prevent it). > > The code is below. Thanks, Joel. I've added this to the bug list and will get to it ASAP. From vjoel at PATH.Berkeley.EDU Tue Mar 8 14:28:45 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Tue Mar 8 14:24:35 2005 Subject: [fxruby-users] two table bugs In-Reply-To: References: <422D069F.9010808@path.berkeley.edu> Message-ID: <422DFCED.9040004@path.berkeley.edu> Dunno if this is related, but the same app (my app, not the test case) just gave me the following, during FXMessageBox.error(): include/FXRuby.h:373: FXASSERT(!NIL_P(obj)) failed. include/FXRuby.h:373: FXASSERT(!NIL_P(obj)) failed. /home/vjoel/path/ids/prj/eval-tool/lib/eval-tool1/gui/FXWindow-ext.rb:74:in `drawCell': NoMethodError: undefined method `draw' for nil:NilClass from /home/vjoel/path/ids/prj/eval-tool/lib/eval-tool1/gui/FXWindow-ext.rb:74:in `drawRange' from /home/vjoel/path/ids/prj/eval-tool/lib/eval-tool1/gui/FXWindow-ext.rb:74:in `drawContents' from /home/vjoel/path/ids/prj/eval-tool/lib/eval-tool1/gui/FXWindow-ext.rb:74:in `error' ... It may just be fallout from the same source of corruption. This part of the code (invocation of #error()) normally works fine. Sorry for the paltry information... From polyergic at gmail.com Mon Mar 14 16:29:07 2005 From: polyergic at gmail.com (Shad Sterling) Date: Mon Mar 14 16:24:38 2005 Subject: [fxruby-users] Does anyone have access to an x86-64 box? In-Reply-To: References: <6d46356bdcf4ff81a83929488452c128@knology.net> <37632e249f7b44f692daa498fbccbc09@knology.net> <4ff84b9905030215532c527f1c@mail.gmail.com> Message-ID: <4ff84b99050314132924eb4fdd@mail.gmail.com> On Thu, 3 Mar 2005 20:08:25 -0600, Lyle Johnson wrote: > > On Mar 2, 2005, at 5:53 PM, Shad Sterling wrote: > > > I have an x86-64 machine at work I can do some with, and I couldn't > > get the fxruby gem to install. > > I've never tried to use fxruby, I suspect the problem is something > > really obvious that the installer isn't giving a clear error message > > about. > > > > [root@datastor rubygems-0.8.6]# gem install fxruby > > > > > Building native extensions. This could take a while... > > can't find header files for ruby. > > > > Well, I should have looked at that more closely: "can't find header > files for ruby". So yes, something appears to be broken in your Ruby > installation before we even get around to FXRuby... > > I'm running PLD, and have installed ruby-1.8.2-2.20040906.4. I looked for a ruby-libs package (in poldek; using primarially ftp://ftp.amd64.ac.pld-linux.org/dists/ac/PLD/amd64/PLD/RPMS/ ), and failed to find one. I thought the package ruby-static might have them, but apparently not. What am I missing here, to get the ruby headers? -- ---------- Please do not send personal (non-list-related) mail to this address. Personal mail should be sent to polyergic@sterfish.com. From lyle at knology.net Mon Mar 14 17:10:19 2005 From: lyle at knology.net (lyle@knology.net) Date: Mon Mar 14 17:05:48 2005 Subject: [fxruby-users] Does anyone have access to an x86-64 box? In-Reply-To: <> References: <> Message-ID: <20050314221019.1988.qmail@webmail2.knology.net> On Mon, 14 Mar 2005 16:29:07 -0500, Shad Sterling wrote : > I'm running PLD, and have installed ruby-1.8.2-2.20040906.4. I looked > for a ruby-libs package (in poldek; using primarially > ftp://ftp.amd64.ac.pld-linux.org/dists/ac/PLD/amd64/PLD/RPMS/ ), and > failed to find one. I thought the package ruby-static might have > them, but apparently not. > > What am I missing here, to get the ruby headers? I'm having trouble finding a list of the packages available for PLD Linux (I'm just not all that familiar with that distro), but for a lot of distros the header files are off in a separate package with a name like "ruby-devel" or the like. There's often a distinction between the basic runtime support package (i.e. the interpreter and standard libraries -- just what you need to run Ruby programs) and the developer support package (which would additionally include the header files). Is there maybe a way to search through PLD's packages for the one that contains the file "ruby.h"? That might be a way to pin it down. From H.Worby at Kinsey.Com Wed Mar 16 10:44:18 2005 From: H.Worby at Kinsey.Com (Harold Worby) Date: Wed Mar 16 10:39:15 2005 Subject: [fxruby-users] FX GUI objects won't display Message-ID: <15B9796CEC983B439B6D241FA55E44741C93C2@kinsey-sbs.kk.local> I'm trying to replace the contents of a FXTreeList and can't get it to display. If I call fillList from the instillation method, the list is displayed correctly, but calling it later will not display. Also I've have a dialog displayed by Msg_Box(). On the first call, it displays correctly but on subsequent calls it never displays. To call fillList I use: filelistproc = proc { filelist } FXButton.new(mat, "File List", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X) do |filelistbutton| filelistbutton.connect(SEL_COMMAND,filelistproc) end This will destroy the old list, but not display the new list. I can, however, crawl the tree with: @group1.children.each {|c| print "Group1 Child ",c.to_s,"\n" c.show c.each {|d| print " D ",d.class,"->",d.to_s,"\n" d.each {|e| print " E ",e.class," ",e.to_s,"\n" #print " E ",e.class,"\n" } #d.children.each{|dc| # print " D child ", dc.to_s,"\n"} } } and see that the new tree exists and is populated. Skipping the .removeChild leaves the old treelist displayed in 1/2 of the window, and add a new FXtreeList to the child list, but the second list does not display. What do i need for do to get the tree list to display when it's replaced? Harold Worby ###################### fillList def fillList @group1.children.each {|c| print "Remove Child ",c.to_s,"\n" @group1.removeChild(c) } $tree= FXTreeList.new(@group1, 0, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_TOP|LAYOUT_RIGHT|TREELIST_SHOWS_LIN ES| TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES|TREELIST_EXTENDEDSELECT) topmost = $tree.addItemLast(nil, $dbname, folder_open, folder_closed) s=File.mtime($dbname).to_s + " : " + File.size($dbname).to_s + " Bytes " topmost = $tree.addItemLast(topmost, s + " Bytes", doc,doc) sql = "select * from archive order by name;" #print sql,"\n" rows = $db.query( sql ) lastname="" branch=topmost rows.each { |row| if row[0] != lastname branch = $tree.addItemLast(topmost, row[0].to_s, folder_open, folder_closed) item = $tree.addItemLast(branch, row[1].to_s, doc, iundo) item.data=rows else branch0 = $tree.addItemLast(branch, row[0].to_s, folder_open, folder_closed) item = $tree.addItemLast(branch0, row[1].to_s, doc, iredo) item.data=rows end lastname= row[0] print "add item ",item.text,"\n" } rows.close end ###################################### Msg_Box def Msg_Box(sentences) w = 350 h = 250 centerX = self.x + (self.width/2) centerY = self.y + (self.height/2) originX = centerX-(w/2) originY = centerY-(h/2) dialog = FXDialogBox.new($application,"Message Box",DECOR_ALL,originX,originY,w,h) outFrame = FXVerticalFrame.new(dialog,LAYOUT_FILL_X|LAYOUT_FILL_Y,0,0,0,0) topFrame = FXHorizontalFrame.new(outFrame,LAYOUT_FILL_X|LAYOUT_FILL_Y,0,0,w,h) bottomFrame = FXHorizontalFrame.new(outFrame,LAYOUT_CENTER_X) list = FXList.new(topFrame,1,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y) button= FXButton.new(bottomFrame,"OK",nil,dialog,FXDialogBox::ID_ACCEPT) sentences.each { | s | list.appendItem(s) } dialog.show end From lyle at knology.net Wed Mar 16 10:52:52 2005 From: lyle at knology.net (lyle@knology.net) Date: Wed Mar 16 10:48:17 2005 Subject: [fxruby-users] FX GUI objects won't display In-Reply-To: <> References: <> Message-ID: <20050316155252.28811.qmail@webmail3.knology.net> On Wed, 16 Mar 2005 09:44:18 -0600, "Harold Worby" wrote : > > I'm trying to replace the contents of a FXTreeList and can't get it to > display. > If I call fillList from the instillation method, the list is displayed > correctly, but calling it later will not display. I think you just need to add a call to create() for the tree items that are created after the program's up and running, e.g. item = $tree.addItemLast(...) item.create For more info, please see this question from the FOX FAQ: http://www.fox-toolkit.com/faq.html#CREATELATER > Also I've have a dialog displayed by Msg_Box(). On the first call, it > displays correctly but on subsequent calls it never displays. This may be the same problem (although I'm not sure). See what changes (if anything) if you add a call to dialog.create right before the call to dialog.show. From H.Worby at Kinsey.Com Thu Mar 17 14:38:59 2005 From: H.Worby at Kinsey.Com (Harold Worby) Date: Thu Mar 17 14:33:50 2005 Subject: [fxruby-users] FX GUI objects won't display Message-ID: <15B9796CEC983B439B6D241FA55E44741C93CC@kinsey-sbs.kk.local> Calling either dialog.create or tree.create both cause Segmentation faults. splitter.rb:292: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [i386-mswin32] Adding item.create had no effect. Harold Worby -----Original Message----- From: lyle@knology.net [mailto:lyle@knology.net] Sent: Wednesday, March 16, 2005 9:53 AM To: Harold Worby Cc: fxruby-users@rubyforge.org Subject: Re: [fxruby-users] FX GUI objects won't display On Wed, 16 Mar 2005 09:44:18 -0600, "Harold Worby" wrote : > > I'm trying to replace the contents of a FXTreeList and can't get it to > display. > If I call fillList from the instillation method, the list is displayed > correctly, but calling it later will not display. I think you just need to add a call to create() for the tree items that are created after the program's up and running, e.g. item = $tree.addItemLast(...) item.create For more info, please see this question from the FOX FAQ: http://www.fox-toolkit.com/faq.html#CREATELATER > Also I've have a dialog displayed by Msg_Box(). On the first call, it > displays correctly but on subsequent calls it never displays. This may be the same problem (although I'm not sure). See what changes (if anything) if you add a call to dialog.create right before the call to dialog.show. From vjoel at PATH.Berkeley.EDU Fri Mar 18 14:14:44 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Fri Mar 18 14:10:08 2005 Subject: [fxruby-users] two table bugs In-Reply-To: <422D069F.9010808@path.berkeley.edu> References: <422D069F.9010808@path.berkeley.edu> Message-ID: <423B28A4.6020907@path.berkeley.edu> Joel VanderWerf wrote: > > The following two problems occur on Windows and Linux, with ruby-1.8.2 > and FXRuby-1.2.5. > > Instead of FXTableItems, (some of) the items of a table are FXHeaderItems. > > A memory problem (all I know is GC.disable seems to prevent it). Time for the wheel to squeak a bit... I've got a new problem, I think. I've worked around above problems, at least on linux, by precreating my table items to make sure they are really FXTableItems. But I still get memory problems (probably dangling pointers left after GC) on windows only. It will take some effort to isolate the problem to a small test case, but before I do that, it would be nice to make sure it really is a different problem. Lyle, any chance of a fix for the reported problems, so I can proceed with this isolation task? Thanks. From lyle at knology.net Sat Mar 19 08:19:45 2005 From: lyle at knology.net (Lyle Johnson) Date: Sat Mar 19 08:15:04 2005 Subject: [fxruby-users] FX GUI objects won't display In-Reply-To: <15B9796CEC983B439B6D241FA55E44741C93CC@kinsey-sbs.kk.local> References: <15B9796CEC983B439B6D241FA55E44741C93CC@kinsey-sbs.kk.local> Message-ID: <5cb8982d7aedfe4462fe812e3ab5ce77@knology.net> On Mar 17, 2005, at 1:38 PM, Harold Worby wrote: > Calling either dialog.create or tree.create both cause Segmentation > faults. > splitter.rb:292: [BUG] Segmentation fault > ruby 1.8.2 (2004-12-25) [i386-mswin32] > > Adding item.create had no effect. OK. I saw the code excerpts in your previous e-mail and was just hazarding a guess based on those. Can you send me the full program (off list) so that I can try to debug what's happening? Also, do you know which version of FXRuby you're running? If you're just using the version of FXRuby that came bundled with the One-Click Installer for Ruby 1.8.2, it's a few releases behind now and it's possible that we've made some bug corrections in the meantime that would address this problem. If I recall correctly, the One-Click Installer for Ruby 1.8.2 came with FXRuby 1.2.2, and we're up to FXRuby 1.2.5 as of a few weeks ago. You can check to see which version of FXRuby is installed with this command: ruby -rfox12 -e 'puts Fox.fxrubyversion' Thanks, Lyle From laurent at moldus.org Sun Mar 20 04:05:02 2005 From: laurent at moldus.org (Laurent Julliard) Date: Sun Mar 20 04:00:18 2005 Subject: [fxruby-users] [Q] Scrolling a tabbook? Message-ID: <423D3CBE.5000800@moldus.org> I am using the Tabbook widget to manage multiple files in an editor. One problem is when there too many files loaded the new tabs get created on the far right of the Tabbook and cannot be accessed. Any hint, tip or work aorund for this? (using FOX 1.2) Thanks! Laurent From vjoel at PATH.Berkeley.EDU Sun Mar 20 04:23:25 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Sun Mar 20 04:18:50 2005 Subject: [fxruby-users] [Q] Scrolling a tabbook? In-Reply-To: <423D3CBE.5000800@moldus.org> References: <423D3CBE.5000800@moldus.org> Message-ID: <423D410D.8040108@path.berkeley.edu> Laurent Julliard wrote: > I am using the Tabbook widget to manage multiple files in an editor. One > problem is when there too many files loaded the new tabs get created on > the far right of the Tabbook and cannot be accessed. > > Any hint, tip or work aorund for this? (using FOX 1.2) A shot in the dark: what happens if you put the tabbook in a scroll window? From jeroen at fox-toolkit.org Sun Mar 20 21:25:50 2005 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Sun Mar 20 21:21:12 2005 Subject: [fxruby-users] [Q] Scrolling a tabbook? In-Reply-To: <423D3CBE.5000800@moldus.org> References: <423D3CBE.5000800@moldus.org> Message-ID: <200503202025.50810.jeroen@fox-toolkit.org> On Sunday 20 March 2005 03:05 am, Laurent Julliard wrote: > I am using the Tabbook widget to manage multiple files in an editor. > One problem is when there too many files loaded the new tabs get > created on the far right of the Tabbook and cannot be accessed. > > Any hint, tip or work aorund for this? (using FOX 1.2) I will try and come up with a new layout algorithm for FXTabBook and FXTabBar in FOX 1.5. Stay tuned.. - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 20:20 03/20/2005 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ From H.Worby at kinsey.com Sun Mar 20 21:58:56 2005 From: H.Worby at kinsey.com (Harold Worby) Date: Sun Mar 20 21:54:07 2005 Subject: [fxruby-users] dialog.execute vs dialog.show Message-ID: In the 'filetext' routine below I'm passing an FStreelistItem and attempting to display the item.data on top of the TreeList. Any idea why using dlg.execute vs. dlg.show would place the TextField at a radically different screen position? dlg.show does as I would expect, placing the field at the top of the main window. dlg.execute places the field over the tree where I but the x coordinate is way to the left. I have no idea where dlg.execute is picking up the y coordinate. Also: How can I determine the width of the FXVerticalFrame the FXTreeList is being displayed in? How can I pickup the screen position of a FXTreeListItem? I tried to use FXEvent.win_y in the trees event code to get the coordinate of the event (close enough) but get a runtime error: 'undefined method `win_y' for Fox::FXEvent:Class (NoMethodError)' Lastly in this code I try to set the FXTextField target to be it's parent dialog window and send a FXDialogBox::ID_CANCEL when it is ckicked to close the dialog. Why doesn't this work? ############### def filetext(item,y) x=getApp()::mainWindow.x y=getApp()::mainWindow.y w=getApp()::mainWindow.width #w=@group1.maxChildWidth() h=22 MsgOut([x,y,w,h]) #dlg = FXDialogBox.new(getApp(),"File Info",DECOR_BORDER,x,y,w,h,2,2,2,2,0,0) dlg = FXDialogBox.new(@group1,"File Info",DECOR_BORDER,x,y,w,h,2,2,2,2,0,0) #initialize(p, ncols, tgt=nil, sel=0, opts=TEXTFIELD_READONLY, x=0, y=0, w=0, h=0, pl=DEFAULT_PAD, pr=DEFAULT_PAD, pt=DEFAULT_PAD, pb=DEFAULT_PAD) # :yields: theTextField textbox=FXTextField.new(dlg, 200, dlg,FXDialogBox::ID_CANCEL, TEXTFIELD_READONLY,2,2,w-4,h-4,0,0,0,0) #(,10,10,w,h,DEFAULT_PAD,DEFAULT_PAD,DEFAULT_PAD,DEFAULT_PAD) textbox.text=item.data.to_s dlg.create #dlg.execute dlg.show end ################ # The FXTreeList definition ################ def filelist $tree= FXTreeList.new(@group1, 0, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_TOP|LAYOUT_RIGHT|TREELIST_SHOWS_LIN ES| TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES|TREELIST_EXTENDEDSELECT) $tree.connect(SEL_CLICKED ) do |sender, selector, ptr| y=FXEvent.win_y y=50+getApp().mainWindow.y MsgOut(["Y="+y.to_s]) if ptr.numChildren == 0 itemselect(sender, selector, ptr,y) end From haroldworby at earthlink.net Sun Mar 20 22:09:00 2005 From: haroldworby at earthlink.net (Harold Worby) Date: Sun Mar 20 22:04:12 2005 Subject: [fxruby-users] FX GUI objects won't display In-Reply-To: <5cb8982d7aedfe4462fe812e3ab5ce77@knology.net> Message-ID: I resolved the issue withe object not displaying. I've discovered you can not call widgit.create durring the application initialize routine, But when creating a widjit later you HAVE to call widgit.create. That's where I was stuck. Here's my ruby version. Guess I neet to update! C:\ruby\me>..\bin\ruby -rfox -e 'puts Fox.fxrubyversion' 1.0.28 but by directory is named C:\ruby\lib\ruby\gems\1.8\gemsfxruby-1.2.2-mswin32 what gives? -----Original Message----- From: fxruby-users-bounces@rubyforge.org [mailto:fxruby-users-bounces@rubyforge.org]On Behalf Of Lyle Johnson Sent: Saturday, March 19, 2005 7:20 AM To: Harold Worby Cc: fxruby-users@rubyforge.org Subject: Re: [fxruby-users] FX GUI objects won't display On Mar 17, 2005, at 1:38 PM, Harold Worby wrote: > Calling either dialog.create or tree.create both cause Segmentation > faults. > splitter.rb:292: [BUG] Segmentation fault > ruby 1.8.2 (2004-12-25) [i386-mswin32] > > Adding item.create had no effect. OK. I saw the code excerpts in your previous e-mail and was just hazarding a guess based on those. Can you send me the full program (off list) so that I can try to debug what's happening? Also, do you know which version of FXRuby you're running? If you're just using the version of FXRuby that came bundled with the One-Click Installer for Ruby 1.8.2, it's a few releases behind now and it's possible that we've made some bug corrections in the meantime that would address this problem. If I recall correctly, the One-Click Installer for Ruby 1.8.2 came with FXRuby 1.2.2, and we're up to FXRuby 1.2.5 as of a few weeks ago. You can check to see which version of FXRuby is installed with this command: ruby -rfox12 -e 'puts Fox.fxrubyversion' Thanks, Lyle _______________________________________________ fxruby-users mailing list fxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users From lyle at knology.net Sun Mar 20 22:49:53 2005 From: lyle at knology.net (Lyle Johnson) Date: Sun Mar 20 22:45:07 2005 Subject: [fxruby-users] FX GUI objects won't display In-Reply-To: References: Message-ID: <6539da3f35fc436cd37fd77500db18e3@knology.net> On Mar 20, 2005, at 9:09 PM, Harold Worby wrote: > Here's my ruby version. Guess I neet to update! > > C:\ruby\me>..\bin\ruby -rfox -e 'puts Fox.fxrubyversion' > 1.0.28 > > but by directory is named > C:\ruby\lib\ruby\gems\1.8\gemsfxruby-1.2.2-mswin32 > what gives? It looks like you have both FXRuby versions 1.0.28 and 1.2.2 installed. That's OK; there's no conflict as far as Ruby's concerned, and it might prove useful to have both versions around in case you come across some older FXRuby-based application that requires FXRuby version 1.0.x instead of 1.2.x. As you noted, the way to determine your installed FXRuby 1.0 version (if any) is to require the 'fox' extension, e.g. ruby -rfox -e 'puts Fox.fxrubyversion' while the way to determine your installed FXRuby 1.2 version (if any) is to require 'fox12', e.g. ruby -rfox12 -e 'puts Fox.fxrubyversion' Hope this helps, Lyle From lyle at knology.net Mon Mar 21 09:18:13 2005 From: lyle at knology.net (Lyle Johnson) Date: Mon Mar 21 09:13:25 2005 Subject: [fxruby-users] dialog.execute vs dialog.show In-Reply-To: References: Message-ID: On Mar 20, 2005, at 8:58 PM, Harold Worby wrote: > Any idea why using dlg.execute vs. dlg.show would place the TextField > at a > radically different screen position? > dlg.show does as I would expect, placing the field at the top of the > main > window. > dlg.execute places the field over the tree where I but the x > coordinate is > way to the left. > I have no idea where dlg.execute is picking up the y coordinate. The FXDialogBox#execute method takes an optional argument that allows you to specify the placement of the dialog box on the screen: http://www.fxruby.org/doc/api/classes/Fox/FXDialogBox.html As shown in the documentation, the default value for that placement argument is PLACEMENT_CURSOR, which means "place this dialog box under the current cursor position", which is usually a pretty good place to put it. In your case, I think you're saying that you want to fix the initial x & y coordinates of the dialog box, so you might instead choose to use the PLACEMENT_DEFAULT option: dlg.execute(PLACEMENT_DEFAULT) Now, the show() method that you're also trying is inherited from the FXWindow class: http://www.fxruby.org/doc/api/classes/Fox/FXWindow.html and it takes no arguments, and its behavior is like PLACEMENT_DEFAULT. For completeness, there's also a different version of show (defined in FXTopWindow) that does take one argument for the 'placement'. > Also: > How can I determine the width of the FXVerticalFrame the FXTreeList is > being > displayed in? Unless I'm misunderstanding the question, just call its width method: theWidth = someVerticalFrame.width > How can I pickup the screen position of a FXTreeListItem? Well, I don't think we have a way to do that, exactly. There's a getItemAt method, which will return a reference to the tree item at some (x, y) position (if any), e.g. theItemAtXY = treeList.getItemAt(x, y) but I don't know of any easy way to get the (x, y) position of an item. > I tried to use FXEvent.win_y in the trees event code to get the > coordinate > of the event (close enough) but get a runtime error: > 'undefined method `win_y' for Fox::FXEvent:Class (NoMethodError)' FXEvent#win_y is an instance method, not a class method. That is, you need to have an FXEvent object lying around and call its win_y() method to get the y-coordinate. > Lastly in this code I try to set the FXTextField target to be it's > parent > dialog window and send a FXDialogBox::ID_CANCEL when it is ckicked to > close > the dialog. Why doesn't this work? I don't think I understand this at all. You're creating a dialog box that contains a text field (which is used to allow the user to enter and edit a line of text), but you want the dialog box to close as soon as the user clicks inside that text field? From H.Worby at Kinsey.Com Mon Mar 21 11:04:51 2005 From: H.Worby at Kinsey.Com (Harold Worby) Date: Mon Mar 21 10:59:25 2005 Subject: [fxruby-users] dialog.execute vs dialog.show Message-ID: <15B9796CEC983B439B6D241FA55E44741C93D4@kinsey-sbs.kk.local> -----Original Message----- From: Lyle Johnson [mailto:lyle@knology.net] Sent: Monday, March 21, 2005 8:18 AM To: Harold Worby Cc: fxruby-users@rubyforge.org Subject: Re: [fxruby-users] dialog.execute vs dialog.show >> I tried to use FXEvent.win_y in the trees event code to get the >> coordinate >> of the event (close enough) but get a runtime error: >> 'undefined method `win_y' for Fox::FXEvent:Class (NoMethodError)' >FXEvent#win_y is an instance method, not a class method. That is, you >need to have an FXEvent object lying around and call its win_y() method >to get the y-coordinate. How would one create FXEvent object that references a widgets events? I mean in: tree= FXTreeList.new(@group1, 0, nil, 0,...) tree.connect(SEL_CLICKED ) do |sender, selector, ptr| y=myFXEvent.win_y itemselect(sender, selector, ptr,y) end How would you declare the myFXEvent object. As part is the application, the widget, or in the event routine? >> Lastly in this code I try to set the FXTextField target to be it's >> parent >> dialog window and send a FXDialogBox::ID_CANCEL when it is ckicked to >> close >> the dialog. Why doesn't this work? >I don't think I understand this at all. You're creating a dialog box >that contains a text field (which is used to allow the user to enter >and edit a line of text), but you want the dialog box to close as soon >as the user clicks inside that text field? The idea is when the user to clicks on a leaf item a read only text box appears over the top of it displaying more detailed information about the item. Then when the user clicks again the text box goes away. I.E. dlg = FXDialogBox.new(@group1,"FileInfo",DECOR_BORDER,x,y,w,h,2,2,2,2,0,0) textbox=FXTextField.new(dlg, 200, dlg,FXDialogBox::ID_CANCEL,TEXTFIELD_READONLY,2,2,w-4,h-4,0,0,0,0) textbox.text=item.data.to_s ... P.S. I now have updated to v1.5. Thanks for the help. From lyle at knology.net Mon Mar 21 20:13:28 2005 From: lyle at knology.net (Lyle Johnson) Date: Mon Mar 21 20:08:39 2005 Subject: [fxruby-users] dialog.execute vs dialog.show In-Reply-To: <15B9796CEC983B439B6D241FA55E44741C93D4@kinsey-sbs.kk.local> References: <15B9796CEC983B439B6D241FA55E44741C93D4@kinsey-sbs.kk.local> Message-ID: On Mar 21, 2005, at 10:04 AM, Harold Worby wrote: > How would one create FXEvent object that references a widgets events? I > mean in: > > tree= FXTreeList.new(@group1, 0, nil, 0,...) > tree.connect(SEL_CLICKED ) do |sender, selector, ptr| > y=myFXEvent.win_y > itemselect(sender, selector, ptr,y) > end > > How would you declare the myFXEvent object. As part is the application, > the widget, or in the event routine? You don't actually create an FXEvent object yourself; FOX creates one and passes it into some message handler routines as the event data. Now in general, you can find out what kind of message data is passed in as the message data for a message handler block by looking at the API documentation for the class that sends the message. In this case, it's an FXTreeList who sends the message (a SEL_CLICKED message), so you look at the docs for FXTreeList: http://www.fxruby.org/doc/api/classes/Fox/FXTreeList.html and in the list of events near the top of that page, you will see that the message data for SEL_CLICKED is a reference to the FXTreeItem that was "clicked". So something like this should do the trick: tree.connect(SEL_CLICKED) do | sender, sel, clickedItem | ... end Now this doesn't tell you anything about the (x, y) position that was clicked, but let's read on... > The idea is when the user to clicks on a leaf item a read only text box > appears over the top of it displaying more detailed information about > the item. Then when the user clicks again the text box goes away. > I.E. > dlg = > FXDialogBox.new(@group1,"FileInfo",DECOR_BORDER,x,y,w,h,2,2,2,2,0,0) > textbox=FXTextField.new(dlg, 200, > dlg,FXDialogBox::ID_CANCEL,TEXTFIELD_READONLY,2,2,w-4,h-4,0,0,0,0) > textbox.text=item.data.to_s OK, so for starters I would recommend calling dlg.execute without any arguments: dlg.execute or explicitly specifying the placement, if you like: dlg.execute(PLACEMENT_CURSOR) so that the dialog box will appear on top of the tree item that the user just clicked. In that case, you don't actually need to know the (x, y) coordinates. Also, if it's a read-only field anyways, I might consider using an FXLabel instead of an FXTextField, since an FXTextField suggests to the user that this is a field they can edit and change. Finally, I think I'd add a "Close" button -- even a small one -- to the dialog box to allow the user to dismiss it. And if that's the case, that you're basically looking for a dialog box with an OK button and some text label, you might instead consider the FXMessageBox class, a subclass of FXDialogBox that is intended exactly for that purpose. > P.S. > I now have updated to v1.5. I hate to ask (because I think I know the answer), but you've updated *what* to version 1.5? ;) > Thanks for the help. No problem! From jacdx at jacobhanson.com Mon Mar 21 22:43:12 2005 From: jacdx at jacobhanson.com (Jacob Hanson) Date: Mon Mar 21 22:38:30 2005 Subject: [fxruby-users] fxiconlist column sorting In-Reply-To: References: <2910207647.20050320180336@jacobhanson.com> Message-ID: <79023029.20050321204312@jacobhanson.com> Hello list, I've been trying to get column sorting working for an FXIconList and I'm not getting anywhere. I've trapped column header clicks, but I don't know how to tell setSortFunc to use a specified column's sorting function. Does anyone have a full example of this working? I'd also be interested in any other fxruby example code I can get my hands on. Thanks, -- _/ _/ _/ Jacob Hanson _/ _/_/_/ mailto:jacdx@jacobhanson.com _/_/_/ _/ _/ http://www.jacobhanson.com From hal9000 at hypermetrics.com Tue Mar 22 03:43:11 2005 From: hal9000 at hypermetrics.com (Hal Fulton) Date: Tue Mar 22 03:38:24 2005 Subject: [fxruby-users] Thinking about Rails and FXRuby Message-ID: <423FDA9F.4040701@hypermetrics.com> Hi, guys... Just some random thoughts here. Please point out anything I'm overlooking. I was thinking about the popularity of Rails, and I got to thinking: It's mostly about doing things automatically, and it's about user interface. So I got to thinking: Could something similar be done in the non-web world, i.e., generate a GUI app rather than a web app? There are some subtleties, of course... HTML is very flexible and lays the burden on the renderer and the layout engine. But the result is fairly ugly. But my basic question is: Is it possible/practical to create a Rails-like tool that will generate fxruby code? And as a side thought, would it be practical to build a CSS-like layer on top of fxruby? All these ideas would involve no changes in fxruby, of course... If you feel like speculating, share your thoughts... Hal From bloritsch at d-haven.org Tue Mar 22 09:06:53 2005 From: bloritsch at d-haven.org (Berin Loritsch) Date: Tue Mar 22 09:02:08 2005 Subject: [fxruby-users] Thinking about Rails and FXRuby In-Reply-To: <423FDA9F.4040701@hypermetrics.com> References: <423FDA9F.4040701@hypermetrics.com> Message-ID: <4240267D.4070406@d-haven.org> Hal Fulton wrote: > Hi, guys... > > Just some random thoughts here. > > Please point out anything I'm overlooking. > > I was thinking about the popularity of Rails, and I got to > thinking: It's mostly about doing things automatically, and > it's about user interface. > > So I got to thinking: Could something similar be done in the > non-web world, i.e., generate a GUI app rather than a web app? It is possible.... In order to make it work seemlessly, you will have to have some automatic binding library do the work for you. The SmallTalk world used ValueHolders that would send events when the property changed allowing both the model and the view to update themselves accordingly. JGoodies followed the same pattern for its binding API. I did some work on a layout engine for Java Swing a while back to provide a simple form oriented layout language. I had a good start, but never finished. However to have automatic layout work (even with a language) it helps to have a working layout manager. That layout manager is responsible for orienting the labels and fields, sizing the form to accomodate different lengths for internationalized text, etc. > > There are some subtleties, of course... HTML is very flexible > and lays the burden on the renderer and the layout engine. > But the result is fairly ugly. For HTML the result is fairly easily tunable within reason. It'll never look like a native Application though. > > But my basic question is: Is it possible/practical to create > a Rails-like tool that will generate fxruby code? I'm sure it is possible. As to practical, I can't answer. It would be very practical to have the tool. > > And as a side thought, would it be practical to build a > CSS-like layer on top of fxruby? ?? Probably not. GUIs are not HTML sheets, having a good layout manager is beneficial though. From lyle at knology.net Tue Mar 22 09:19:24 2005 From: lyle at knology.net (lyle@knology.net) Date: Tue Mar 22 09:14:36 2005 Subject: [fxruby-users] Thinking about Rails and FXRuby In-Reply-To: <> References: <> Message-ID: <20050322141924.20913.qmail@webmail3.knology.net> On Tue, 22 Mar 2005 09:06:53 -0500, Berin Loritsch wrote : > It is possible.... > > In order to make it work seemlessly, you will have to have some > automatic binding library do the work for you. The SmallTalk world > used ValueHolders that would send events when the property changed > allowing both the model and the view to update themselves accordingly. > JGoodies followed the same pattern for its binding API. I'm not yet familiar with ValueHolders or JGoodies, but what you're describing reminds me a little of how data targets work in FXRuby. Also Joel VanderWerf's FoxTails extensions. > > I did some work on a layout engine for Java Swing a while back to > provide a simple form oriented layout language. I had a good start, > but never finished. > > However to have automatic layout work (even with a language) it helps > to have a working layout manager. That layout manager is responsible > for orienting the labels and fields, sizing the form to accomodate > different lengths for internationalized text, etc. I'm not sure how to read this last part. Are you implying that FOX doesn't already have a "working" layout manager? If not, what is it that you feel is missing from FOX's layout manager choices? > > > > And as a side thought, would it be practical to build a > > CSS-like layer on top of fxruby? > > ?? Probably not. GUIs are not HTML sheets, having a good layout > manager is beneficial though. I'm not sure if this is what Hal was getting at, but I've often thought it would be useful to have some kind of external file in which you could specify certain visual aspects of a FOX application more easily. One could argue that the FOX registry already provides a mechanism for setting user preferences (such as which font to use, which color scheme, etc.) but it's a bit awkward to edit those registry settings and to swap out one entire set of, um, settings for another set of settings (as opposed to the ease of swapping out CSS stylesheets on the fly for a Web site). From vjoel at PATH.Berkeley.EDU Tue Mar 22 14:53:15 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Tue Mar 22 14:48:41 2005 Subject: [fxruby-users] Thinking about Rails and FXRuby In-Reply-To: <20050322141924.20913.qmail@webmail3.knology.net> References: <> <20050322141924.20913.qmail@webmail3.knology.net> Message-ID: <424077AB.2030702@path.berkeley.edu> lyle@knology.net wrote: > On Tue, 22 Mar 2005 09:06:53 -0500, Berin Loritsch > wrote : > > >>It is possible.... >> >>In order to make it work seemlessly, you will have to have some >>automatic binding library do the work for you. The SmallTalk world >>used ValueHolders that would send events when the property changed >>allowing both the model and the view to update themselves accordingly. >>JGoodies followed the same pattern for its binding API. > > > I'm not yet familiar with ValueHolders or JGoodies, but what you're > describing reminds me a little of how data targets work in FXRuby. Also Joel > VanderWerf's FoxTails extensions. FoxTails (and observable) are, to me anyway, more ruby-like ways to do what FXDataTarget does. YMMV wildly. I think using the dynamic nature of ruby to generate UI from specification is a good idea. I'm not very familiar with rails, but maybe you mean, for example, widgets that automatically configure themselves to talk to a database? Sounds cool... Btw, FoxTails has an experimental feature to do this with hierarchical (not relational) data. If you have a data structure that is tree-like (or more general actually), you can wire it up to a tree browser. From info at sten-net.de Wed Mar 23 10:20:46 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Wed Mar 23 10:16:02 2005 Subject: [fxruby-users] FXDCWindow::drawText encoding Message-ID: <4241894E.3080605@sten-net.de> Hi all. I just started experimenting with the FOX drawing functions. After having a little problem with text positioning, I know stumbled into an encoding problem (at least, I think so). Whenever I want to draw something like "foo\nbar" or "foo\r\nbar" I get those ugly squares (which likely symbolize a char the font (?) is not able to display). Screenshot is attached. My system's encoding is UTF-8, by the way. Any ideas? Regards, Jannis -------------- next part -------------- A non-text attachment was scrubbed... Name: Bildschirmfoto-TodoListEditor: Zeichentests.png Type: image/png Size: 4363 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20050323/77abf591/Zeichentests.png From jeroen at fox-toolkit.org Wed Mar 23 10:39:30 2005 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Wed Mar 23 10:34:39 2005 Subject: [fxruby-users] FXDCWindow::drawText encoding In-Reply-To: <4241894E.3080605@sten-net.de> References: <4241894E.3080605@sten-net.de> Message-ID: <200503230939.30107.jeroen@fox-toolkit.org> On Wednesday 23 March 2005 09:20 am, Jannis Pohlmann wrote: > Hi all. > > I just started experimenting with the FOX drawing functions. After > having a little problem with > text positioning, I know stumbled into an encoding problem (at least, I > think so). > > Whenever I want to draw something like "foo\nbar" or "foo\r\nbar" I get > those ugly squares (which > likely symbolize a char the font (?) is not able to display). > > Screenshot is attached. My system's encoding is UTF-8, by the way. > > Any ideas? Please note that dc.drawText() does not do any formatting, it just draws the visible characters and draws "replacement" characters for the formatting characters like \n and \t. If you want interpretation of the formatting, just place a text widget and it will do a lot of formatting for you; alternatively you can write a loop; here is what FXLabel uses: beg=0; do{ end=beg; while(endgetFontHeight(); beg=end+1; } while(end References: <4241894E.3080605@sten-net.de> <200503230939.30107.jeroen@fox-toolkit.org> Message-ID: <42418E9A.6030304@sten-net.de> Jeroen van der Zijp schrieb: >On Wednesday 23 March 2005 09:20 am, Jannis Pohlmann wrote: > > >>Hi all. >> >>I just started experimenting with the FOX drawing functions. After >>having a little problem with >>text positioning, I know stumbled into an encoding problem (at least, I >>think so). >> >>Whenever I want to draw something like "foo\nbar" or "foo\r\nbar" I get >>those ugly squares (which >>likely symbolize a char the font (?) is not able to display). >> >>Screenshot is attached. My system's encoding is UTF-8, by the way. >> >>Any ideas? >> >> > >Please note that dc.drawText() does not do any formatting, it just draws >the visible characters and draws "replacement" characters for the formatting >characters like \n and \t. > >If you want interpretation of the formatting, just place a text widget and >it will do a lot of formatting for you; alternatively you can write a loop; >here is what FXLabel uses: > > beg=0; > do{ > end=beg; > while(end dc.drawText(xx,yy,&text[beg],end-beg); > yy+=font->getFontHeight(); > beg=end+1; > } > while(end >I know you're working in Ruby, and this is C++. But I hope you get the >idea:- hunt for the \n, then draw up to that, move to the next line and >hunt for the next \n. Repeat until the whole string is done.... > > Thanks very much, Jeroen. Wrapping this into correct Ruby code won't be much of a problem. >P.S. As for utf-8, this capability will be in FOX in the 1.6 version; >the plan is to have unicode drawing support for all widgets, and have >some stuff in place for localization. > > Yeah, I'm really looking forward to it. Regards, Jannis From info at sten-net.de Wed Mar 23 10:59:13 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Wed Mar 23 10:54:24 2005 Subject: [fxruby-users] FXDCWindow::drawText encoding In-Reply-To: <42418E9A.6030304@sten-net.de> References: <4241894E.3080605@sten-net.de> <200503230939.30107.jeroen@fox-toolkit.org> <42418E9A.6030304@sten-net.de> Message-ID: <42419251.5070703@sten-net.de> BTW, this should be most typical for Ruby (assuming you already know the coordinates where you want to draw): str = "foo\nbar" # or "foo\r\nbar" lines = str.split(/[\r]?\n/) nr = 0 lines.each do |line| dc.drawText(x, y + dc.font.fontAscent + nr * dc.font.fontHeight, line) nr += 1 end Hails, Jannis From polyergic at gmail.com Wed Mar 23 17:25:03 2005 From: polyergic at gmail.com (Shad Sterling) Date: Wed Mar 23 17:20:11 2005 Subject: [fxruby-users] Does anyone have access to an x86-64 box? In-Reply-To: <20050314221019.1988.qmail@webmail2.knology.net> References: <20050314221019.1988.qmail@webmail2.knology.net> Message-ID: <4ff84b99050323142529e8662a@mail.gmail.com> On 14 Mar 2005 22:10:19 -0000, lyle@knology.net wrote: > > On Mon, 14 Mar 2005 16:29:07 -0500, Shad Sterling wrote : > > > I'm running PLD, and have installed ruby-1.8.2-2.20040906.4. I looked > > for a ruby-libs package (in poldek; using primarially > > ftp://ftp.amd64.ac.pld-linux.org/dists/ac/PLD/amd64/PLD/RPMS/ ), and > > failed to find one. I thought the package ruby-static might have > > them, but apparently not. > > > > What am I missing here, to get the ruby headers? > > I'm having trouble finding a list of the packages available for PLD Linux > (I'm just not all that familiar with that distro), but for a lot of distros > the header files are off in a separate package with a name like "ruby-devel" > or the like. There's often a distinction between the basic runtime support > package (i.e. the interpreter and standard libraries -- just what you need > to run Ruby programs) and the developer support package (which would > additionally include the header files). > > Is there maybe a way to search through PLD's packages for the one that > contains the file "ruby.h"? That might be a way to pin it down. > Duh. The PLD package ruby-devel has the headers. I don't think of installing as a developer task, so I didn't think of looking at the developer packages. (Nevermind that fxruby is more or less a developer tool...) It turns out that I can't use the gem to run that file anyway, I had to build fxruby from source, which was easy enough except that I didn't see a list anywhere of which -devel packages need to be installed. (Looks like ruby, fox, and glibc.) Now that I have everything installed, I can run the file, and it exits cleanly after almost .5s. Whatever the problem is, it appears to not occur under PLD. - Shad -- ---------- Please do not send personal (non-list-related) mail to this address. Personal mail should be sent to polyergic@sterfish.com. From davidp at touringcyclist.com Wed Mar 23 17:32:57 2005 From: davidp at touringcyclist.com (David Peoples) Date: Wed Mar 23 17:26:18 2005 Subject: [fxruby-users] FXListBox size behavior? Message-ID: <4241EE99.9090102@touringcyclist.com> The default behavior of FXListBox seems to be to grow and shrink in width depending on the length of the selected entry in the list. This is a problem when the list contains items of varying width, because if a short item is picked then the longer entries are obscured in the drop-down list. Is this deliberate, an oversight, or a bug? Its certainly not how I'd choose it to act. Is there some combination of options in the "new" method, or some layout manager setup, that can force the listbox to stay one (appropriately wide) width? Code to demonstrate the problem below. David -- 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 ----------------------------------------------------- #!/usr/bin/env ruby # tested using FXRuby 1.2.5 and Ruby 1.8.2 (One-click installer # on Windows XP) require 'fox12' include Fox application = FXApp.new("listboxtest", "FoxTest") main = FXMainWindow.new(application, "FXListBox test", nil, nil, DECOR_ALL, 0, 0, 400, 200) myListBox = FXListBox.new(main) myListBox.appendItem("a very long example") myListBox.appendItem("short") myListBox.appendItem("longer") myListBox.appendItem("even longer") myListBox.appendItem("shorter") myListBox.numVisible = myListBox.numItems application.create main.show(PLACEMENT_SCREEN) application.run From jeroen at fox-toolkit.org Wed Mar 23 22:24:34 2005 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Wed Mar 23 22:19:46 2005 Subject: [fxruby-users] FXListBox size behavior? In-Reply-To: <4241EE99.9090102@touringcyclist.com> References: <4241EE99.9090102@touringcyclist.com> Message-ID: <200503232124.35108.jeroen@fox-toolkit.org> On Wednesday 23 March 2005 04:32 pm, David Peoples wrote: > The default behavior of FXListBox seems to be to grow and shrink in > width depending on the length of the selected entry in the list. This is > a problem when the list contains items of varying width, because if a > short item is picked then the longer entries are obscured in the > drop-down list. > Is this deliberate, an oversight, or a bug? Its certainly not how I'd > choose it to act. Is there some combination of options in the "new" > method, or some layout manager setup, that can force the listbox to stay > one (appropriately wide) width? Yes, looking through the code I see that there could indeed be a problem. What happens is that the getDefaultWidth() of the FXListBox reflects only the size of the currently selected text, and not the size of ALL the texts in the list. This is wrong, plain and simple! In FXComboBox I fixed this by setting HSCROLLING_OFF on the embedded FXList, if the combobox is static. Since FXListBox pretty much behaves like a static FXComboBox, this should probably be done inside FXListBox also. I would suggest, for now, hard-wire the size of the FXListBox to the desired width, with the LAYOUT_FIX_WIDTH flag. Then the parent widget will ignore the value of getDefaultWidth() and just give it the right size. Thanks for the bug report, Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 19:30 03/23/2005 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ From davidp at touringcyclist.com Wed Mar 23 23:30:37 2005 From: davidp at touringcyclist.com (David Peoples) Date: Wed Mar 23 23:25:54 2005 Subject: [fxruby-users] FXListBox size behavior? In-Reply-To: <200503232124.35108.jeroen@fox-toolkit.org> References: <4241EE99.9090102@touringcyclist.com> <200503232124.35108.jeroen@fox-toolkit.org> Message-ID: <4242426D.7080008@touringcyclist.com> Jeroen van der Zijp wrote: > On Wednesday 23 March 2005 04:32 pm, David Peoples wrote: > >>The default behavior of FXListBox seems to be to grow and shrink in >>width depending on the length of the selected entry in the list. This is >>a problem when the list contains items of varying width, because if a >>short item is picked then the longer entries are obscured in the >>drop-down list. ... > I would suggest, for now, hard-wire the size of the FXListBox to the desired > width, with the LAYOUT_FIX_WIDTH flag. Then the parent widget will ignore > the value of getDefaultWidth() and just give it the right size. > > > Thanks for the bug report, > > > Jeroen > > OK, that work-around works for me. Thanks. David -- David Peoples davidp@touringcyclist.com http://www.touringcyclist.com The Touring Cyclist, 11816 St. Charles Rock Road, Bridgeton MO 63044 tel: 314-739-4648 fax: 314-739-4972 From olivers at mondrian-ide.com Thu Mar 24 00:32:50 2005 From: olivers at mondrian-ide.com (Oliver Smith) Date: Thu Mar 24 00:26:13 2005 Subject: [fxruby-users] fox 1.2 - FXMenuCheck errata In-Reply-To: <2f71014837ce67ae7e8c4f54958def10@knology.net> Message-ID: Still on the long conversion process to Fox 1.2... :) I got my menus moved to the new FXMenuCheck class and noticed that the 'checked?' instance method no longer seems to exist. So I switched over to 'getCheck', which works, except my observed behavior is that it returns true when the menu is NOT checked, and vice versa. It was easy to solve with this: class FXMenuCheck def checked? return !getCheck end end Thanks, Oliver Smith From lyle at knology.net Thu Mar 24 08:06:34 2005 From: lyle at knology.net (Lyle Johnson) Date: Thu Mar 24 08:01:35 2005 Subject: [fxruby-users] fox 1.2 - FXMenuCheck errata In-Reply-To: References: Message-ID: On Mar 23, 2005, at 11:32 PM, Oliver Smith wrote: > Still on the long conversion process to Fox 1.2... :) I got my menus > moved > to the new FXMenuCheck class and noticed that the 'checked?' instance > method > no longer seems to exist. So I switched over to 'getCheck', which > works, > except my observed behavior is that it returns true when the menu is > NOT > checked, and vice versa. It was easy to solve with this: > > class FXMenuCheck > def checked? > return !getCheck > end > end Thanks, Oliver! I've added this to the bug list and will try to get it fixed for the next release. From info at sten-net.de Thu Mar 24 08:58:36 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Thu Mar 24 08:53:45 2005 Subject: [fxruby-users] "Undefined" methods in FXScrollArea Message-ID: <4242C78C.1080706@sten-net.de> Hi Lyle, just wanted to let you know of two mistakes in the API docs: FXScrollArea does not know the attributes verticalScrollbar and horizontalScrollbar. They are written verticalScrollBar and horizontalScrollBar. Regards, Jannis From lyle at knology.net Thu Mar 24 09:23:23 2005 From: lyle at knology.net (lyle@knology.net) Date: Thu Mar 24 09:18:30 2005 Subject: [fxruby-users] "Undefined" methods in FXScrollArea In-Reply-To: <> References: <> Message-ID: <20050324142323.20464.qmail@webmail3.knology.net> On Thu, 24 Mar 2005 14:58:36 +0100, Jannis Pohlmann wrote : > just wanted to let you know of two mistakes in the API docs: > > FXScrollArea does not know the attributes verticalScrollbar and > horizontalScrollbar. They are written > verticalScrollBar and horizontalScrollBar. Thanks! I've just added a bug report for this and it should be fixed for the next release. From H.Worby at kinsey.com Mon Mar 28 00:24:30 2005 From: H.Worby at kinsey.com (Harold Worby) Date: Mon Mar 28 00:19:32 2005 Subject: [fxruby-users] Retriving FXTextField Data Message-ID: I must be missing something very basic. The following code displays a dialog with three text fields. The fields are initalized with values from an FXTable object. When I edit the data in the fields an click the Accept button I expected the FXTextField.text property to contain the modyfied text. What I get is the original unmodified text. How do I reference the modifyed text? Harold ---------------------------------------------------------------------------- ------ def dlgNewTest(cell) dlg = FXDialogBox.new(getApp(),"Destination",DECOR_TITLE|DECOR_BORDER,0,0,0,0) outter = FXVerticalFrame.new(dlg,LAYOUT_FILL_X|LAYOUT_FILL_Y) # Initalize Contents fields = FXVerticalFrame.new(outter,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 FXButton.new(buttons, "&Accept", nil, dlg, FXDialogBox::ID_ACCEPT, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y){ print "Accept1 ",cell.row," ",txtName.text,"\n" print "Accept2 ",cell.row," ",txtPath.text,"\n" print "Accept3 ",cell.row," ",txtSize.text,"\n" @table.setItemText(cell.row,1,txtName.text) @table.setItemText(cell.row,2,txtPath.text) @table.setItemText(cell.row,3,txtSize.text) } # Cancel FXButton.new(buttons, "&Cancel", nil, dlg, FXDialogBox::ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) # Delete FXButton.new(buttons, "&Delete", nil, dlg, FXDialogBox::ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) dlg.create dlg.execute end From vjoel at PATH.Berkeley.EDU Mon Mar 28 01:57:08 2005 From: vjoel at PATH.Berkeley.EDU (Joel VanderWerf) Date: Mon Mar 28 01:52:28 2005 Subject: [fxruby-users] Retriving FXTextField Data In-Reply-To: References: Message-ID: <4247AAC4.8020504@path.berkeley.edu> Harold Worby wrote: > FXButton.new(buttons, "&Accept", nil, dlg, FXDialogBox::ID_ACCEPT, > FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y){ > print "Accept1 ",cell.row," ",txtName.text,"\n" > print "Accept2 ",cell.row," ",txtPath.text,"\n" > print "Accept3 ",cell.row," ",txtSize.text,"\n" > @table.setItemText(cell.row,1,txtName.text) > @table.setItemText(cell.row,2,txtPath.text) > @table.setItemText(cell.row,3,txtSize.text) > } You are missing a ".connect(SEL_COMMAND)" before the { . I make that mistake often :) From haroldworby at earthlink.net Mon Mar 28 23:59:59 2005 From: haroldworby at earthlink.net (Harold Worby) Date: Mon Mar 28 23:54:59 2005 Subject: [fxruby-users] Retriving FXTextField Data In-Reply-To: <4247AAC4.8020504@path.berkeley.edu> Message-ID: OK Thanks, 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). Wich 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? FXButton.new(buttons, "&Accept", nil, dlg, FXDialogBox::ID_ACCEPT, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y).connect(SEL_COMMAND ){ @table.setItemText(cell.row,1,txtName.text) @table.setItemText(cell.row,2,txtPath.text) @table.setItemText(cell.row,3,txtSize.text) } -----Original Message----- From: fxruby-users-bounces@rubyforge.org [mailto:fxruby-users-bounces@rubyforge.org]On Behalf Of Joel VanderWerf Sent: Monday, March 28, 2005 12:57 AM To: H.Worby@kinsey.com; fxruby-users@rubyforge.org Subject: Re: [fxruby-users] Retriving FXTextField Data Harold Worby wrote: > FXButton.new(buttons, "&Accept", nil, dlg, FXDialogBox::ID_ACCEPT, > FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y){ > print "Accept1 ",cell.row," ",txtName.text,"\n" > print "Accept2 ",cell.row," ",txtPath.text,"\n" > print "Accept3 ",cell.row," ",txtSize.text,"\n" > @table.setItemText(cell.row,1,txtName.text) > @table.setItemText(cell.row,2,txtPath.text) > @table.setItemText(cell.row,3,txtSize.text) > } You are missing a ".connect(SEL_COMMAND)" before the { . I make that mistake often :) _______________________________________________ fxruby-users mailing list fxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users From lyle at knology.net Tue Mar 29 07:19:25 2005 From: lyle at knology.net (Lyle Johnson) Date: Tue Mar 29 07:14:22 2005 Subject: [fxruby-users] Retriving FXTextField Data In-Reply-To: References: Message-ID: 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 From tom at ahsmart.com Wed Mar 30 09:41:35 2005 From: tom at ahsmart.com (Tom Kwong) Date: Wed Mar 30 09:36:34 2005 Subject: [fxruby-users] FXRuby compilation error - invalid conversion Message-ID: <1112193695.3819.7.camel@ftlinux.ahsmart.com> Need help. I can't get FXRuby to compile... FXRuby.cpp: In function `void FXRbDestroyAppSensitiveObjects()': FXRuby.cpp:1741: error: invalid conversion from `int (*)(...)' to `int (*)()' FXRuby.cpp:1775: error: invalid conversion from `int (*)(...)' to `int (*)()' system = Linux version 2.6.8.1-3-386 (buildd@terranova) (gcc version 3.3.4 (Debian 1:3.3.4-9ubuntu5)) #1 Tue Oct 12 12:41:57 BST 2004 ruby = ruby 1.8.2 (2004-08-24) [i386-linux] fox = 1.2.16 fxruby = 1.2.5 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20050330/321eb846/attachment.htm From lyle at knology.net Thu Mar 31 07:58:16 2005 From: lyle at knology.net (Lyle Johnson) Date: Thu Mar 31 07:53:06 2005 Subject: [fxruby-users] FXRuby compilation error - invalid conversion In-Reply-To: <1112193695.3819.7.camel@ftlinux.ahsmart.com> References: <1112193695.3819.7.camel@ftlinux.ahsmart.com> Message-ID: <81e66eefa8ce0a84f52871f6e4e296f8@knology.net> On Mar 30, 2005, at 8:41 AM, Tom Kwong wrote: > Need help.? I can't get FXRuby to compile... > > FXRuby.cpp: In function `void FXRbDestroyAppSensitiveObjects()': > FXRuby.cpp:1741: error: invalid conversion from `int (*)(...)' to > `int (*)()' > FXRuby.cpp:1775: error: invalid conversion from `int (*)(...)' to > `int (*)()' > > system = Linux version 2.6.8.1-3-386 (buildd@terranova) (gcc version > 3.3.4 (Debian 1:3.3.4-9ubuntu5)) #1 Tue Oct 12 12:41:57 BST 2004 > ruby = ruby 1.8.2 (2004-08-24) [i386-linux] > fox = 1.2.16 > fxruby = 1.2.5 You're still using one of the preview releases of Ruby 1.8.2; I can tell by the date in the version string (2004-08-24). Please upgrade to the final release of Ruby 1.8.2, which should report version information something like this: $ ruby-v ruby 1.8.2 (2004-12-25) [powerpc-darwin7.7.0] Hope this helps, Lyle