From fxruby at gmail.com Sun May 1 23:36:04 2005 From: fxruby at gmail.com (Richard Lyman) Date: Sun May 1 23:29:56 2005 Subject: [fxruby-users] Errors in RDoc for FXTable? Message-ID: I'm working with FXTable, and I'm getting errors that 'visibleCols' is not a property - 'visibleColumns' doesn't have that error, but the document says the first case is the property. 'leadingCols' doesn't work as well as 'leadingColumns'. 'leadingRows' seems to have problems as well. I just thought you might want to know. Thanks for the great work!! -Rich From lyle at knology.net Mon May 2 09:39:36 2005 From: lyle at knology.net (Lyle Johnson) Date: Mon May 2 09:33:17 2005 Subject: [fxruby-users] Errors in RDoc for FXTable? In-Reply-To: References: Message-ID: <0dbcf32bdb299e6febed0c961e18a572@knology.net> On May 1, 2005, at 10:36 PM, Richard Lyman wrote: > I'm working with FXTable, and I'm getting errors that 'visibleCols' is > not a property - 'visibleColumns' doesn't have that error, but the > document says the first case is the property. > > 'leadingCols' doesn't work as well as 'leadingColumns'. 'leadingRows' > seems to have problems as well. Yes, these are documentation errors. As you've discovered, "visibleCols" has been renamed to "visibleColumns", and the "leadingRows", "leadingCols", "trailingRows" and "trailingCols" properties are just gone altogether in FOX 1.2. From p.e.c.melis at rug.nl Tue May 3 08:58:44 2005 From: p.e.c.melis at rug.nl (Paul Melis) Date: Tue May 3 08:52:37 2005 Subject: [fxruby-users] Extending fxruby with c++ operating on an FXImage? Message-ID: <42777584.7030802@rug.nl> Hello, I'm currently doing a little app that works on images and corrects lens distortion. It is fully written in c++ using fox (1.4), but I'm interested in converting it to ruby+fxruby. However, the c++ code that does the actual work on the images will need to stay c++, for performance reasons. It currently isn't too speedy, so converting that part to ruby too will make it to slow to use. The image processing actually works on an input FXImage object and outputs a new processed one. I'm wondering how easy it would be to create a ruby extension that interfaces with the processing code while still allowing the newly created FXImage's to be used by fxruby (as I want to display the results obviously). Will a simple swig interface definition for a c++ function like FXImage* processImage(const FXImage* img, ); be enough or does fxruby do more tricks underwater that I would need to duplicate? Thanks in advance, Paul From jacdx at jacobhanson.com Sun May 8 14:24:49 2005 From: jacdx at jacobhanson.com (Jacob Hanson) Date: Sun May 8 14:18:33 2005 Subject: [fxruby-users] composite widgets In-Reply-To: References: <426FD80C.7080101@touringcyclist.com> Message-ID: <515193947.20050508122449@jacobhanson.com> Hello list, Let's pretend I need to create some sort of composite widget... like a self-contained widget that had a series of other widgets built-in internally, like combo boxes and textfields. Ideally, I would like this composite widget to behave like a regular Fox widget and respond to layout hints. How would I go about this? Can I do it in FXRuby or does it have to be done in Fox/C? Do I need to subclass some sort of surface/container widget like FXScrollArea or FXWindow or can I just use a generic class? Any direction is appreciated! Thanks, -- _/ _/ _/ Jacob Hanson _/ _/_/_/ mailto:jacdx@jacobhanson.com _/_/_/ _/ _/ http://www.jacobhanson.com From info at sten-net.de Sun May 8 17:09:19 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Sun May 8 17:03:05 2005 Subject: [fxruby-users] composite widgets In-Reply-To: <515193947.20050508122449@jacobhanson.com> References: <426FD80C.7080101@touringcyclist.com> <515193947.20050508122449@jacobhanson.com> Message-ID: <427E7FFF.9050905@sten-net.de> Jacob Hanson schrieb: >Hello list, > >Let's pretend I need to create some sort of composite widget... like >a self-contained widget that had a series of other widgets built-in >internally, like combo boxes and textfields. Ideally, I would like >this composite widget to behave like a regular Fox widget and respond >to layout hints. > >How would I go about this? Can I do it in FXRuby or does it have to be >done in Fox/C? Do I need to subclass some sort of surface/container widget like >FXScrollArea or FXWindow or can I just use a generic class? > >Any direction is appreciated! > >Thanks > > Hello Jacob. Yu can actually do this in FXRuby. Usually, you'd subclass a container widget like FXPacker, FXMatrix or FXVerticalFrame. That's the most preferable way to easily to manage and react child widgets. Even in C++ that's the best solution since most of the child wigets are going to be automatically destroyed by their parent, then. Regards, Jannis From cribbsj at oakwood.org Mon May 9 10:50:10 2005 From: cribbsj at oakwood.org (Jamey Cribbs) Date: Mon May 9 10:43:48 2005 Subject: [fxruby-users] FXTableItem Icon Message-ID: <427F78A2.6000602@oakwood.org> Sorry if this has been answered already; I googled but did not find anything close. I am attempting to add a checkmark icon to FXListView (which is a sub-classed FXRuby FXTable) to designate boolean fields. The problem I am running into is this: when I addendRow and setItemIcon to the checkmark image, *every* subsequent record that I append has a checkmark in the same column, even if I setItemIcon = nil or setItemIcon = differentIcon. The only way I have found to set individual cells to have an icon is to wait until I have appended all row and then setItemIcon for a single cell (similar to the table.rb example supplied with FXRuby). What I am trying to do is when I append a row, if a field is a boolean, I will setItemIcon = checkmark if the field's value is tru and setItemIcon = nil if the field's value is false. But, I would like to do it will I am appending the row, not later after I have appended all rows. Is this possible? Am I doing something wrong? 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 jacdx at jacobhanson.com Thu May 12 03:06:08 2005 From: jacdx at jacobhanson.com (Jacob Hanson) Date: Thu May 12 02:59:48 2005 Subject: [fxruby-users] composite widgets In-Reply-To: <427E7FFF.9050905@sten-net.de> References: <426FD80C.7080101@touringcyclist.com> <515193947.20050508122449@jacobhanson.com> <427E7FFF.9050905@sten-net.de> Message-ID: <436684678.20050512010608@jacobhanson.com> Sunday, May 8, 2005, 3:09:19 PM, you wrote > Hello Jacob. > Yu can actually do this in FXRuby. > Usually, you'd subclass a container widget like FXPacker, FXMatrix or > FXVerticalFrame. That's the most > preferable way to easily to manage and react child widgets. Even in C++ > that's the best solution since > most of the child wigets are going to be automatically destroyed by > their parent, then. Thanks Jannis, I have begun implementing it based off of FXVerticalFrame. Here's a related question. This widget needs to expand/contract based on the number of items that have been added to it. I can do this after everything is created and call myframe.create; myframe.recalc to update the controls that need to be drawn or hidden and resize my frame accordingly. But! If I attempt to add or remove an item before the rest of the containing window is drawn for the first time, I get a segfault when trying to .create. Is there a way to test if I need to run .create or should I be doing something different? Thanks, Jacob From info at sten-net.de Thu May 12 05:32:42 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Thu May 12 05:26:27 2005 Subject: [fxruby-users] composite widgets In-Reply-To: <436684678.20050512010608@jacobhanson.com> References: <426FD80C.7080101@touringcyclist.com> <515193947.20050508122449@jacobhanson.com> <427E7FFF.9050905@sten-net.de> <436684678.20050512010608@jacobhanson.com> Message-ID: <428322BA.6060800@sten-net.de> Jacob Hanson schrieb: >Sunday, May 8, 2005, 3:09:19 PM, you wrote > >>Hello Jacob. >>Yu can actually do this in FXRuby. >> > >>Usually, you'd subclass a container widget like FXPacker, FXMatrix or >>FXVerticalFrame. That's the most >>preferable way to easily to manage and react child widgets. Even in C++ >>that's the best solution since >>most of the child wigets are going to be automatically destroyed by >>their parent, then. >> > >Thanks Jannis, > >I have begun implementing it based off of FXVerticalFrame. Here's a >related question. This widget needs to expand/contract based on the >number of items that have been added to it. I can do this after >everything is created and call myframe.create; myframe.recalc to >update the controls that need to be drawn or hidden and resize my >frame accordingly. But! If I attempt to add or remove an item >before the rest of the containing window is drawn for the first time, >I get a segfault when trying to .create. Is there a way to test if >I need to run .create or should I be doing something different? > >Thanks, > >Jacob > Hi Jacob, When adding/removing items before the parent widget is created you won't have to call create on them. The creation of the parent widget does that automatically. But when adding/removing items after the parent's creation you will have to call .create on each new item and call .recalc of the parent widget. The two ways: class YourWidget < FXVerticalFrame def initialize(parent, opts) super end def create super end def addLabel(text) FXLabel.new(self, text) do |label| label.create end self.recalc end end or class YourWidget < FXVerticalFrame def initialize(parent, opts) super texts = Array.new(["text1", "text2", "text3"]) texts.each do |txt| FXLabel.new(self, txt) end end def create super end # Of course, you could use the "addLabel" method here, too. end Hope this helps, Jannis From jacdx at jacobhanson.com Thu May 12 11:25:03 2005 From: jacdx at jacobhanson.com (Jacob Hanson) Date: Thu May 12 11:18:45 2005 Subject: [fxruby-users] composite widgets In-Reply-To: <428322BA.6060800@sten-net.de> References: <426FD80C.7080101@touringcyclist.com> <515193947.20050508122449@jacobhanson.com> <427E7FFF.9050905@sten-net.de> <436684678.20050512010608@jacobhanson.com> <428322BA.6060800@sten-net.de> Message-ID: <1937354211.20050512092503@jacobhanson.com> Thursday, May 12, 2005, 3:32:42 AM, you wrote: > When adding/removing items before the parent widget is created you won't > have to call > create on them. The creation of the parent widget does that > automatically. But when > adding/removing items after the parent's creation you will have to call > .create on each new > item and call .recalc of the parent widget. > The two ways: > class YourWidget < FXVerticalFrame > def initialize(parent, opts) > super > end > def create > super > end > def addLabel(text) > FXLabel.new(self, text) do |label| > label.create > end > self.recalc > end > end Hi Jannis, This makes sense. This is how my widget is laid out. But, is there a way to make addLabel versatile enough so that I can call it before the parent widget is fully created (not call .create) and also be able to call it after the parent widget is created (do call create)? Or do I need to have two separate methods? The way I have it, if I remove .create from my addLabel method, it will create the initial items I need to create. But, since .create is gone, the items I add after everything is created (e.g. from user input) won't draw. If I leave .create in, I get a segfault. Is there some sort of flag that tells me that .create has already been run? Thanks, Jacob From lyle at knology.net Thu May 12 11:37:33 2005 From: lyle at knology.net (lyle@knology.net) Date: Thu May 12 11:31:08 2005 Subject: [fxruby-users] composite widgets In-Reply-To: <> References: <> Message-ID: <20050512153733.10001.qmail@webmail1.knology.net> On Thu, 12 May 2005 09:25:03 -0600, Jacob Hanson wrote : > If I leave .create in, I get a segfault. Is there some sort of > flag that tells me that .create has already been run? Yes. You can call created? on a widget (or any object whose class is derived from FXId) to determine whether it's been created yet. So something like this should work: def addLabel(text) FXLabel.new(self, text) do |label| label.create if created? end recalc end As it sounds like you've discovered, your program will definitely crash if you call create() on a child widget (such as a label added in addLabel) before you've called create() on the parent widget. From jacdx at jacobhanson.com Fri May 13 00:28:27 2005 From: jacdx at jacobhanson.com (Jacob Hanson) Date: Fri May 13 00:22:01 2005 Subject: [fxruby-users] defining events in fox 1.2 Message-ID: <1176542292.20050512222827@jacobhanson.com> Thanks to the list I'm back to progressing with my custom control. Now, what I can't find after an hour of RTFM is how to define events so that something can .connect to them. I read how the older, C++ Fox-like .enum/FXMAPFUNC/Responder interface was replaced with the .connect interface for handling events in your applications. But when you're building a widget, how do you define those events? Say I have a widget that should do nothing else but change the background color of itself when clicked. The only thing that I can fathom at this point is that you have to use Responder's .enum to define your desired custom message IDs (perhaps ID_RED, ID_BLUE for background colors) and then use FXMAPFUNC to map the message type + message ID combinations to actual methods inside the widget (e.g. FXMAPFUNC(SEL_COMMAND, ID_RED, :onSetRedBackground)) Is this the correct way to do it with FXRuby 1.2? Thx. Jacob From dr.klepp at gmx.at Fri May 13 06:55:19 2005 From: dr.klepp at gmx.at (Dr. Nikolaus Klepp) Date: Fri May 13 06:49:12 2005 Subject: [fxruby-users] problem with FXMemoryBuffer and OpenGL Message-ID: <200505131255.33963.dr.klepp@gmx.at> Hi! I just tried to migrate a program fom FOX 1.0 to FOX 1.2 and ran intgo this problem (ruby 1.8.2): FXMemoryBuffer::data does not return an array of FXColor, but the same string I get when I call FXMemoryBuffer::to_s (it's 33 chars long). Despite FXMemoryBuffer::[] works and I can access the individual pixels. In consquence I can't access the bitmaps and can't build an OpenGL texture. example: ... img = FXPNGImage.new(@@application, nil, IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP) ... GL::TexImage2D(GL::TEXTURE_2D,0,GL::RGBA,img.width,img.height,0,GL::RGBA GL::UNSIGNED_BYTE,img.data.to_s) ... works using FOX 1.0, fails using FOX 1.2. Any idea how to solve this? nik -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20050513/d59a2ae4/attachment-0001.bin From info at sten-net.de Fri May 13 07:11:52 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Fri May 13 07:05:28 2005 Subject: [fxruby-users] defining events in fox 1.2 In-Reply-To: <1176542292.20050512222827@jacobhanson.com> References: <1176542292.20050512222827@jacobhanson.com> Message-ID: <42848B78.4060407@sten-net.de> Jacob Hanson schrieb: >Thanks to the list I'm back to progressing with my custom control. >Now, what I can't find after an hour of RTFM is how to define events >so that something can .connect to them. > >I read how the older, C++ Fox-like .enum/FXMAPFUNC/Responder interface was >replaced with the .connect interface for handling events in your >applications. But when you're building a widget, how do you define those >events? > >Say I have a widget that should do nothing else but change the background >color of itself when clicked. The only thing that I can fathom at this point >is that you have to use Responder's .enum to define your desired custom message >IDs (perhaps ID_RED, ID_BLUE for background colors) and then use FXMAPFUNC to map >the message type + message ID combinations to actual methods inside >the widget (e.g. FXMAPFUNC(SEL_COMMAND, ID_RED, :onSetRedBackground)) >Is this the correct way to do it with FXRuby 1.2? > I'm still a little uncertain about the use of .connect since it doesn't completely replace the old C++-style mechanism. Example: If you have a widget and want to overload the paint handler you have to call FXMAPFUNC(SEL_PAINT, 0, "onPaint") since self.connect(SEL_PAINT, method(:onPaint)) doesn't do the job (although it actually should). However, you can also create objects this way: FXButton.new(...) do |btn| btn.connect(SEL_COMMAND, method(:OnClick)) end If you have more than one button calling the :OnClick method you can determine which button was clicked later: def OnClick(sender, sel, event) case FXSELID(sel) when ID_RED puts "Red button clicked" break when ID_YELLOW puts "Yellow button clicked" break end end This sometimes makes code a little more compact and allows you to react on similar objects the same way (and spares duplicating code to a certain extend). Hope this helps, Jannis From lyle at knology.net Fri May 13 09:01:31 2005 From: lyle at knology.net (Lyle Johnson) Date: Fri May 13 08:55:04 2005 Subject: [fxruby-users] Extending fxruby with c++ operating on an FXImage? In-Reply-To: <42777584.7030802@rug.nl> References: <42777584.7030802@rug.nl> Message-ID: On May 3, 2005, at 7:58 AM, Paul Melis wrote: > Hello, > > I'm currently doing a little app that works on images and corrects > lens distortion. It is fully written in c++ using fox (1.4), but I'm > interested in converting it to ruby+fxruby. However, the c++ code that > does the actual work on the images will need to stay c++, for > performance reasons. It currently isn't too speedy, so converting that > part to ruby too will make it to slow to use. > > The image processing actually works on an input FXImage object and > outputs a new processed one. I'm wondering how easy it would be to > create a ruby extension that interfaces with the processing code while > still allowing the newly created FXImage's to be used by fxruby (as I > want to display the results obviously). Will a simple swig interface > definition for a c++ function like > > FXImage* processImage(const FXImage* img, ); > > be enough or does fxruby do more tricks underwater that I would need > to duplicate? Unfortunately, there's a lot more to it than that and it's not something that can be easily simplified at this point. What I am wondering, however, is you could compromise by still doing all of the compute-intensive image processing in your C++ extension code and then construct the new FXImage object back in the Ruby layer. I haven't put as much thought into this as you have, obviously, but I'm thinking of something long these lines: memBuffer = inputImage.data colorArray = memBuffer.data # an array of FXColor values newColorArray = processImageData(colorArray, ... other parameters ...) newImage = FXImage.new(app, newColorArray, ...) In in approach like this, your extension code (that implements the processImageData method) doesn't know anything about FOX or FXRuby per se, it's just manipulating a Ruby Array of color values (32-bit unsigned longs). Hope this helps, Lyle From lyle at knology.net Fri May 13 09:08:54 2005 From: lyle at knology.net (Lyle Johnson) Date: Fri May 13 09:02:25 2005 Subject: [fxruby-users] problem with FXMemoryBuffer and OpenGL In-Reply-To: <200505131255.33963.dr.klepp@gmx.at> References: <200505131255.33963.dr.klepp@gmx.at> Message-ID: <0bb19aee4db30d26eb786a85807b9fac@knology.net> On May 13, 2005, at 5:55 AM, Dr. Nikolaus Klepp wrote: > I just tried to migrate a program fom FOX 1.0 to FOX 1.2 and ran intgo > this > problem (ruby 1.8.2): > > FXMemoryBuffer::data does not return an array of FXColor, but the same > string > I get when I call FXMemoryBuffer::to_s (it's 33 chars long). Despite > FXMemoryBuffer::[] works and I can access the individual pixels. In > consquence I can't access the bitmaps and can't build an OpenGL > texture. Nik, This sounds like a bug that was fixed in FXRuby 1.2.4 (see http://www.fxruby.org/doc/changes.html). Are you sure you're using the latest release of FXRuby 1.2? A quick way to check is by typing: ruby -rfox12 -e 'puts Fox.fxrubyversion' at the command line. If you're running FXRuby version 1.2.3 or earlier, please upgrade first and then let me know if the problem persists. Hope this helps, Lyle From corelon at gmail.com Fri May 13 11:35:19 2005 From: corelon at gmail.com (Nick Tzanos) Date: Fri May 13 11:28:52 2005 Subject: [fxruby-users] FXRuby on Windows Ruby Installer Message-ID: Hello, I am a new user to Ruby and I installed the Windows Ruby Installer. When I try to run some tutorial examples I get errors. More specifically the one I remember is with FXToolTip. which throws an error saying: uninitialized constant FXTooltip (NameError) It seems that some of the controls cannot be loaded. Could you please guide me on the subject? Thanks Nick Tzanos From lyle at knology.net Fri May 13 11:59:02 2005 From: lyle at knology.net (lyle@knology.net) Date: Fri May 13 11:52:36 2005 Subject: [fxruby-users] FXRuby on Windows Ruby Installer In-Reply-To: <> References: <> Message-ID: <20050513155902.3661.qmail@webmail2.knology.net> On Fri, 13 May 2005 18:35:19 +0300, Nick Tzanos wrote : > When I try to run some tutorial examples I get errors. More > specifically the one I remember is with FXToolTip. which throws an > error saying: > > uninitialized constant FXTooltip (NameError) > > It seems that some of the controls cannot be loaded. Could you please > guide me on the subject? You may be looking at a tutorial for an older version of FXRuby, and things may have changed that "break" that tutorial. Which tutorial example(s) are you looking at? Can you be more specific? From lyle at knology.net Fri May 13 11:59:02 2005 From: lyle at knology.net (lyle@knology.net) Date: Fri May 13 11:52:36 2005 Subject: [fxruby-users] FXRuby on Windows Ruby Installer In-Reply-To: <> References: <> Message-ID: <20050513155902.3661.qmail@webmail2.knology.net> On Fri, 13 May 2005 18:35:19 +0300, Nick Tzanos wrote : > When I try to run some tutorial examples I get errors. More > specifically the one I remember is with FXToolTip. which throws an > error saying: > > uninitialized constant FXTooltip (NameError) > > It seems that some of the controls cannot be loaded. Could you please > guide me on the subject? You may be looking at a tutorial for an older version of FXRuby, and things may have changed that "break" that tutorial. Which tutorial example(s) are you looking at? Can you be more specific? From jacdx at jacobhanson.com Sun May 15 18:46:16 2005 From: jacdx at jacobhanson.com (Jacob Hanson) Date: Sun May 15 18:39:46 2005 Subject: [fxruby-users] storing widget references in hash Message-ID: <1222997201.20050515164616@jacobhanson.com> Hello List, I'm keeping an hash of controls I create, e.g. myArray['label'] = FXLabel.new(... myArray['dropdown'] = FXComboBox.new(... But, if I 'p' the hash, instead of seeing references to the widget objects, all that gets stored are the labels for the controls, as if I was saying FXComboBox.new().to_s. But I'm not. Hash doesn't do an internal type conversion of values does it? Any other reason why I would be seeing this? Thanks, -- _/ _/ _/ Jacob Hanson _/ _/_/_/ mailto:jacdx@jacobhanson.com _/_/_/ _/ _/ http://www.jacobhanson.com From lyle at knology.net Sun May 15 19:31:32 2005 From: lyle at knology.net (Lyle Johnson) Date: Sun May 15 19:24:57 2005 Subject: [fxruby-users] FXRuby on Windows Ruby Installer In-Reply-To: References: <20050513155902.3661.qmail@webmail2.knology.net> Message-ID: On May 15, 2005, at 12:21 PM, Nick Tzanos wrote: > Hello again, > I am using the tutorial examples that are inside ArachnoRuby 0.5.6 > (Scriptolutions). > I think these certainly refer to a different version as in the require > field it says: > require 'fox' > and not > require 'fox12' OK, yes, it sounds like those tutorials were written for FXRuby 1.0. > Could you please give me some guidance on where to find tutorials > about recent versions and also if I can have access to a reference of > the API (which I haven't been able to find still) A good start would be the FXRuby home page (http://www.fxruby.org), don't you think? There are a few tutorial exercises there, in the FXRuby User's Guide, as well as an online API reference guide. From info at sten-net.de Mon May 16 06:11:32 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Mon May 16 06:05:57 2005 Subject: [fxruby-users] storing widget references in hash In-Reply-To: <1222997201.20050515164616@jacobhanson.com> References: <1222997201.20050515164616@jacobhanson.com> Message-ID: <428871D4.80403@sten-net.de> Jacob Hanson schrieb: >Hello List, > >I'm keeping an hash of controls I create, e.g. > >myArray['label'] = FXLabel.new(... >myArray['dropdown'] = FXComboBox.new(... > >But, if I 'p' the hash, instead of seeing references to the widget >objects, all that gets stored are the labels for the controls, as if I >was saying FXComboBox.new().to_s. But I'm not. Hash doesn't do an >internal type conversion of values does it? Any other reason why I >would be seeing this? > >Thanks, > > Hi Jacob. That's due to the overloaded .to_s functions in (nearly) all FXRuby classes. To ensure you still have references to the objects instead of just their labels in your hash try to call myArray.each_value do |val| puts val.class end If you get Fox::FXLabel and Fox::FXComboBox as output everything is still ok. By the way, an example for a FXRuby class which has no overloaded .to_s function is FXFont: puts FXFont.new(getApp, "verdana", 10) Regards, Jannis From cribbsj at oakwood.org Mon May 16 11:24:52 2005 From: cribbsj at oakwood.org (Jamey Cribbs) Date: Mon May 16 11:18:21 2005 Subject: [fxruby-users] Weird FXTable gc related problem Message-ID: <4288BB44.1000701@oakwood.org> Ok, I've got a really weird problem cropping up. I have a FXRuby app that is showing a FXTable with each row being a database record. I have a menu on the screen. If you select "Add" from the menu, my app opens up another window (FXDialog) that allows you to add a new record to the database. If you click "Cancel" on this edit screen, it closes the FXDialog and takes you back to the FXTable screen and refreshes the data in the FXTable from the database. This works fine. I wanted to set up hotkeys to allow the user to do the exact same thing via keystrokes. So I added an accelator to the acceltable for the app. When I test this, it bombs. If I am sitting on the FXTable screen and I hit Ctrl+A, it opens the edit screen just like it should. However, if I click on the "Cancel" button on this screen, my app bombs. The error and line number it gives me hops around a little bit, but it goes something like this: c:/work/ruby/lib/fxstuff/fxlistview.rb:188: [BUG] rb_gc_mark(): unknown data type 0x13(0x27341a4) non object ruby 1.8.2 (2004-12-25) [i386-mswin32] It is bombing in fxlistview.rb, which is my subclassed FXTable. Something else interesting. If I turn off garbage collection, this error does not occur. Now, the strange thing is, I am executing the exact same routine when I click on the "Add" menu or when I hit "Ctrl+A". Here is the code that maps my Add method to an ID: FXMAPFUNC(SEL_COMMAND, ID_ADD, :onCmdAdd) Here is the code that adds the accelerator: self.accelTable.addAccel(fxparseAccel("Ctl-A"), self, FXSEL(SEL_COMMAND, ID_ADD)) Here is the code that adds the menu command: @menuItems[:add] = FXMenuCommand.new(editmenu, "&Add\tCtl-A\tAdd a new record.", $icons[:add], self, ID_ADD) It has something to do with garbage collection, but why would my app behave differently based on whether I click on a menu command or whether I press a hotkey. Both are executing onCmdAdd using FXMAPFUNC. Does any on this ring a bell to anyone? I know it would help to post some code, but my app is pretty complex and it will take some work to rip out enough code to post something that would work. Any hep would be greatly appreciated! 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 info at sten-net.de Mon May 16 14:02:35 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Mon May 16 13:56:02 2005 Subject: [fxruby-users] FXScrollArea messages Message-ID: <4288E03B.9040207@sten-net.de> Hi Lyle, hi list. I've got a few problems getting a subclass of FXScrollArea react on SEL_MOTION and SEL_LEFTBUTTONPRESS. In the constructor I wrote FXMAPFUNC(SEL_MOTION, 0, "onMouseMove") FXMAPFUNC(SEL_LEFTBUTTONPRESS, 0, "onLeftClick") I also tried self.connect(SEL_MOTION, method(:onMouseMove)) self.connect(SEL_LEFTBUTTONPRESS, method(:onLeftClick)) But when I use this widget those handler functions are never called, even if I call .setFocus on it. Any ideas? Regards, Jannis From info at sten-net.de Mon May 16 19:02:19 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Mon May 16 18:55:51 2005 Subject: [fxruby-users] TEXTFIELD_ENTER_ONLY doesn't work Message-ID: <4289267B.8070906@sten-net.de> Hi Lyle, I noticed that when creating a FXTextField with TEXTFIELD_ENTER_ONLY it still sends messages to its target when other keys than KEY_Return are pressed. I usually create a textfield this way: textfield = FXTextField.new(self, 50, self, ID_INPUT, TEXTFIELD_ENTER_ONLY) textfield.setText(aStr) textfield.setFocus textfield.move(x, y, w, h) textfield.show This way only the enter key should send the message SEL_KEYPRESSED/SEL_KEYRELEASED with ID_INPUT to the target. But that somehow doesn't work. Regards, Jannis From info at sten-net.de Mon May 16 19:09:08 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Mon May 16 19:02:35 2005 Subject: [fxruby-users] TEXTFIELD_ENTER_ONLY doesn't work In-Reply-To: <4289267B.8070906@sten-net.de> References: <4289267B.8070906@sten-net.de> Message-ID: <42892814.7080809@sten-net.de> Jannis Pohlmann schrieb: > Hi Lyle, > > I noticed that when creating a FXTextField with TEXTFIELD_ENTER_ONLY > it still sends messages > to its target when other keys than KEY_Return are pressed. > > I usually create a textfield this way: > > textfield = FXTextField.new(self, 50, self, ID_INPUT, > TEXTFIELD_ENTER_ONLY) > textfield.setText(aStr) > textfield.setFocus > textfield.move(x, y, w, h) > textfield.show > > This way only the enter key should send the message > SEL_KEYPRESSED/SEL_KEYRELEASED with > ID_INPUT to the target. But that somehow doesn't work. > > Regards, > Jannis Oh well, my fault. I just saw that it sends a SEL_COMMAND when KEY_Return is pressed, not a SEL_KEYPRESS or SEL_KEYRELEASE. That works fine. So please ignore the message before. - Jannis From colotechpro at yahoo.com Tue May 17 22:59:27 2005 From: colotechpro at yahoo.com (John Reed) Date: Tue May 17 22:52:51 2005 Subject: [fxruby-users] FXTable - columns are no longer resizable Message-ID: <20050518025927.43330.qmail@web14523.mail.yahoo.com> I upgraded to Fox 1.2, more specifically 1.2.6 and now this line doesn't make the columns resizable: @table = FXTable.new(frame, nil, 0, TABLE_COL_SIZABLE|TABLE_HEADERS_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0,0,0,0, 2,2,2,2) I've looked at the new documentation, including the upgrade notes, and there isn't anything I can find that addresses this. Other details: ruby 1.8.2 (2004-12-25) [i386-mswin32] *** LOCAL GEMS *** fxruby (1.2.6, 1.2.2) FXRuby is the Ruby binding to the FOX GUI toolkit. Thanks for your help, John Reed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20050517/68115215/attachment.htm From stevetuckner at usfamily.net Wed May 18 14:42:13 2005 From: stevetuckner at usfamily.net (Steve Tuckner) Date: Wed May 18 14:36:12 2005 Subject: [fxruby-users] GP on Windows XP with threading Message-ID: <428B8C85.10907@usfamily.net> Hello all, I have written a relatively small app that is a kind of IRB written in Fox. You enter an expression into an edit box on one tab and then the app switches to another tab to display the results. It also connects using DRb server which contains an object that is part of the IRB's binding (I don't use the IRB class in Ruby by the way). If my expressions don't cause a DRb transaction to occur, then the application doesn't crash. But if it does then I can crash the app (GP) by doing 1-10 expressions involving the remote object. I am not really sure how to debug this issue further other than isolating it which I am willing to do, but I am not sure what to isolate. Any suggestions to debug this problem would be great. I really like the functionality that I have built into it and don't relish duplicating this functionality using a different toolkit (ie. WxRuby or VRuby). I recently upgraded it to use Fox 1.2 hoping that that would fix it, but it didn't. I am going to try the same thing on Linux to see if it occurs there. I am using 1.8.2-14 on Windows (The Prag/Programmers installation). Thanks, Steve Tuckner P.S. If anyone wants the source to try this with, I will be happy to send it to them. From lyle at knology.net Wed May 18 15:59:15 2005 From: lyle at knology.net (lyle@knology.net) Date: Wed May 18 15:52:37 2005 Subject: [fxruby-users] Re: FXTable possible bug In-Reply-To: <> References: <> Message-ID: <20050518195915.10498.qmail@webmail3.knology.net> On Wed, 18 May 2005 23:12:03 +0400, Pavel Sokolov wrote : > I am still learning to deal with FOX and playing with different > widgets. I have encountered strange behavior of FXTable with regard to > style options. FXTable allows to resize rows and columns both w/ and > w/o options TABLE_ROW_SIZABLE, TABLE_COL_SIZABLE. This bug in FOX 1.2 was reported to Jeroen back in February 2005 and, as far as I know, it was only fixed in the FOX 1.4 branch (i.e. he has not gone back and fixed it in FOX 1.2). See this message from the FOX Users' Mailing List Archive: http://sourceforge.net/mailarchive/message.php?msg_id=10944941 Regards, Lyle From lyle at knology.net Wed May 18 16:07:45 2005 From: lyle at knology.net (lyle@knology.net) Date: Wed May 18 16:01:07 2005 Subject: [fxruby-users] Re: FXTable possible bug In-Reply-To: <> References: <> Message-ID: <20050518200745.13242.qmail@webmail3.knology.net> On Wed, 18 May 2005 23:12:03 +0400, Pavel Sokolov wrote : > Secondly, [FXTable] shows the following error: > > C:/shna/rr/script/cod/gui.rb:20:in `buildUI': undefined method `trailingCols=' f > or # (NoMethodError) > from C:/shna/rr/script/cod/gui.rb:12:in `initialize' > from C:/shna/rr/script/cod/gui.rb:32:in `new' > from C:/shna/rr/script/cod/gui.rb:32 > I believe that's a documentation bug, and that those accessors (leadingRows, leadingCols, trailingRows and trailingRows) are no longer present in FXRuby 1.2. I will add a bug report on this. From info at sten-net.de Wed May 18 16:14:52 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Wed May 18 16:21:32 2005 Subject: [fxruby-users] FXScrollArea messages In-Reply-To: <4288E03B.9040207@sten-net.de> References: <4288E03B.9040207@sten-net.de> Message-ID: <428BA23C.9020401@sten-net.de> Jannis Pohlmann schrieb: > Hi Lyle, hi list. > > I've got a few problems getting a subclass of FXScrollArea react on > SEL_MOTION and SEL_LEFTBUTTONPRESS. > > In the constructor I wrote > > FXMAPFUNC(SEL_MOTION, 0, "onMouseMove") > FXMAPFUNC(SEL_LEFTBUTTONPRESS, 0, "onLeftClick") > > I also tried > > self.connect(SEL_MOTION, method(:onMouseMove)) > self.connect(SEL_LEFTBUTTONPRESS, method(:onLeftClick)) > > But when I use this widget those handler functions are never called, even > if I call .setFocus on it. > > Any ideas? > > Regards, > Jannis > Hey Lyle, didn't you see that message? I don't want to be impatient, but this problem is really important for a project of mine. I browsed the FOX source and FXRuby's SWIG interfaces and noticed that FXScrollArea doesn't implement the SEL_MOTION handler as FXCanvas does. Obviously, FXTable (derived from FXScrollArea) is able to react on SEL_MOTION. FXScrollArea is a subclass of FXComposite which itself is a subclass of FXWindow so shouldn't classes derived from FXScrollArea be able to handle SEL_MOTION? Same with other cursor messages like SEL...BUTTONPRESS, SEL...BUTTONRELEASE or SEL_CLICKED. No ideas? Thanks in advance, Jannis From stevetuckner at usfamily.net Wed May 18 17:42:37 2005 From: stevetuckner at usfamily.net (stevetuckner) Date: Wed May 18 17:36:27 2005 Subject: [fxruby-users] GP on Windows XP with threading In-Reply-To: <428B8C85.10907@usfamily.net> References: <428B8C85.10907@usfamily.net> Message-ID: <428BB6CD.1020404@usfamily.net> Sorry to respond to my old post, but I have also now reproduced the problem on Linux. Steve Tuckner wrote: > Hello all, > > I have written a relatively small app that is a kind of IRB written in > Fox. You enter an expression into an edit box on one tab and then the > app switches to another tab to display the results. It also connects > using DRb server which contains an object that is part of the IRB's > binding (I don't use the IRB class in Ruby by the way). If my > expressions don't cause a DRb transaction to occur, then the > application doesn't crash. But if it does then I can crash the app > (GP) by doing 1-10 expressions involving the remote object. > > I am not really sure how to debug this issue further other than > isolating it which I am willing to do, but I am not sure what to isolate. > > Any suggestions to debug this problem would be great. I really like > the functionality that I have built into it and don't relish > duplicating this functionality using a different toolkit (ie. WxRuby > or VRuby). I recently upgraded it to use Fox 1.2 hoping that that > would fix it, but it didn't. > > I am going to try the same thing on Linux to see if it occurs there. I > am using 1.8.2-14 on Windows (The Prag/Programmers installation). > > Thanks, > > Steve Tuckner > > P.S. If anyone wants the source to try this with, I will be happy to > send it to them. > _______________________________________________ > fxruby-users mailing list > fxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From lyle at knology.net Wed May 18 19:43:38 2005 From: lyle at knology.net (Lyle Johnson) Date: Wed May 18 19:36:58 2005 Subject: [fxruby-users] FXTable - columns are no longer resizable In-Reply-To: <20050518025927.43330.qmail@web14523.mail.yahoo.com> References: <20050518025927.43330.qmail@web14523.mail.yahoo.com> Message-ID: <34bf051197a782414f4ca05f4419773a@knology.net> On May 17, 2005, at 9:59 PM, John Reed wrote: > I upgraded to Fox 1.2, more specifically 1.2.6 and now this line > doesn't make the columns resizable: > ? > @table = FXTable.new(frame,? nil, 0, > ????? > TABLE_COL_SIZABLE|TABLE_HEADERS_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y, > ????? 0,0,0,0, 2,2,2,2)? Please see my reply to this message: http://rubyforge.org/pipermail/fxruby-users/2005-May/000356.html It's a known bug in FOX 1.2 which Jeroen may (or may not) fix in a future release -- but it's somewhat out of my control. From lyle at knology.net Wed May 18 22:09:51 2005 From: lyle at knology.net (Lyle Johnson) Date: Wed May 18 22:03:10 2005 Subject: [fxruby-users] defining events in fox 1.2 In-Reply-To: <1176542292.20050512222827@jacobhanson.com> References: <1176542292.20050512222827@jacobhanson.com> Message-ID: On May 12, 2005, at 11:28 PM, Jacob Hanson wrote: > Thanks to the list I'm back to progressing with my custom control. > Now, what I can't find after an hour of RTFM is how to define events > so that something can .connect to them. > > I read how the older, C++ Fox-like .enum/FXMAPFUNC/Responder interface > was > replaced with the .connect interface for handling events in your > applications. But when you're building a widget, how do you define > those > events? The purpose of the connect() method is to set up a mapping between messages (like SEL_COMMAND) that are sent by a widget to its message target, and the method or block of code that should handle that message. So, for one of the built-in widgets, if you read in its documentation that it sends, say, the SEL_CHANGED message to its message target, you can call connect(SEL_CHANGED) on that widget: widgetThatSendsMessage.connect(SEL_CHANGED) { ... } Now if you have a custom widget that you'd like for others to be able to call connect() on, you need to be sure that your custom widget sends message(s) to its target when interesting things happen (where the definition of "interesting" is up to you). For example, class MyCustomWidget def methodWhereSomethingInterestingHappens # Let's send a SEL_COMMAND message to my message target target.handle(self, FXSEL(SEL_COMMAND, selector), nil) end end and then clients would use it as: x = MyCustomWidget.new(...) x.connect(SEL_COMMAND) { ... } > Say I have a widget that should do nothing else but change the > background > color of itself when clicked. The only thing that I can fathom at this > point > is that you have to use Responder's .enum to define your desired > custom message > IDs (perhaps ID_RED, ID_BLUE for background colors) and then use > FXMAPFUNC to map > the message type + message ID combinations to actual methods inside > the widget (e.g. FXMAPFUNC(SEL_COMMAND, ID_RED, :onSetRedBackground)) > Is this the correct way to do it with FXRuby 1.2? For this particular example, it doesn't sound like your widget is actually sending messages out to a target object; it's just implementing a custom behavior in response to being "clicked". You can sort-of "abuse" the connect() method in this case, however, to make the widget itself its own target, e.g. self.connect(SEL_COMMAND) { self.changeMyBackgroundColor() } Hope this helps, Lyle From lyle at knology.net Wed May 18 22:14:38 2005 From: lyle at knology.net (Lyle Johnson) Date: Wed May 18 22:07:59 2005 Subject: [fxruby-users] FXScrollArea messages In-Reply-To: <4288E03B.9040207@sten-net.de> References: <4288E03B.9040207@sten-net.de> Message-ID: <96e0d0a3b132a46c1482e12d36874489@knology.net> On May 16, 2005, at 1:02 PM, Jannis Pohlmann wrote: > I've got a few problems getting a subclass of FXScrollArea react on > SEL_MOTION and SEL_LEFTBUTTONPRESS. > > In the constructor I wrote > > FXMAPFUNC(SEL_MOTION, 0, "onMouseMove") > FXMAPFUNC(SEL_LEFTBUTTONPRESS, 0, "onLeftClick") > > I also tried > > self.connect(SEL_MOTION, method(:onMouseMove)) > self.connect(SEL_LEFTBUTTONPRESS, method(:onLeftClick)) > > But when I use this widget those handler functions are never called, > even > if I call .setFocus on it. Could you send me some sample code that demonstrates the problem? The first approach that you mentioned is the right idea, although there may be some piece missing in the bridge from FOX to FXRuby. The second example definitely wouldn't work, because FXScrollArea doesn't forward those messages to its message target, and that's what connect() is all about: setting up a map the messages that a widget sends to its message target, and some chunk of code to handle that message. From lyle at knology.net Wed May 18 22:24:39 2005 From: lyle at knology.net (Lyle Johnson) Date: Wed May 18 22:17:58 2005 Subject: [fxruby-users] FXScrollArea messages In-Reply-To: <428BA23C.9020401@sten-net.de> References: <4288E03B.9040207@sten-net.de> <428BA23C.9020401@sten-net.de> Message-ID: On May 18, 2005, at 3:14 PM, Jannis Pohlmann wrote: > Hey Lyle, didn't you see that message? Yes. Sorry I didn't drop everything and respond immediately. > I don't want to be impatient, but this problem is really important for > a project > of mine. I browsed the FOX source and FXRuby's SWIG interfaces and > noticed > that FXScrollArea doesn't implement the SEL_MOTION handler as FXCanvas > does. Correct. If you look at the message map for the FXScrollArea class (which appears near the top of FXScrollArea.cpp in the FOX source code) you'll see that the FXScrollArea widget isn't "listening" for SEL_MOTION events from the FOX event loop. > Obviously, FXTable (derived from FXScrollArea) is able to react on > SEL_MOTION. Yes, also correct. If you look at the message map for FXTable (at the top of FXTable.cpp), that widget *is* listening for SEL_MOTION events (and handling them in the FXTable::onMotion member function). > FXScrollArea is a subclass of FXComposite which itself is a subclass of > FXWindow so shouldn't classes derived from FXScrollArea be able to > handle > SEL_MOTION? FXScrollArea (and any other class derived from FXWindow) is certainly able to receive those messages, but I guess you could say it's choosing not to. That is, there's no entry for SEL_MOTION in FXScrollArea's message map and so it hasn't requested that those messages be sent to it. Jeroen presumably did this to avoid sending any possibly unneeded messages to that widget, and left it up to subclasses (like FXTable) to register their interest in receiving those events from the event loop. From info at sten-net.de Thu May 19 07:47:13 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Thu May 19 07:40:37 2005 Subject: [fxruby-users] FXScrollArea messages In-Reply-To: <96e0d0a3b132a46c1482e12d36874489@knology.net> References: <4288E03B.9040207@sten-net.de> <96e0d0a3b132a46c1482e12d36874489@knology.net> Message-ID: <428C7CC1.7010302@sten-net.de> Lyle Johnson schrieb: > > On May 16, 2005, at 1:02 PM, Jannis Pohlmann wrote: > >> I've got a few problems getting a subclass of FXScrollArea react on >> SEL_MOTION and SEL_LEFTBUTTONPRESS. >> >> In the constructor I wrote >> >> FXMAPFUNC(SEL_MOTION, 0, "onMouseMove") >> FXMAPFUNC(SEL_LEFTBUTTONPRESS, 0, "onLeftClick") >> >> I also tried >> >> self.connect(SEL_MOTION, method(:onMouseMove)) >> self.connect(SEL_LEFTBUTTONPRESS, method(:onLeftClick)) >> >> But when I use this widget those handler functions are never called, >> even >> if I call .setFocus on it. > > > Could you send me some sample code that demonstrates the problem? The > first approach that you mentioned is the right idea, although there > may be some piece missing in the bridge from FOX to FXRuby. > > The second example definitely wouldn't work, because FXScrollArea > doesn't forward those messages to its message target, and that's what > connect() is all about: setting up a map the messages that a widget > sends to its message target, and some chunk of code to handle that > message. > Alright, I read your mail concerning "defining events in fox 1.2" and I think I got the point about the .connect() method. Thank's for explaining that! Here's my code, originally about 300 lines stripped down to what you should need: require "fox12" require "fox12/responder" require "fox12/colors" include Fox class CustomTable < FXScrollArea include Responder ID_SELF, ID_INPUT = enum(FXScrollArea::ID_LAST, 2) def initialize(parent, tgt, sel) super(parent, LAYOUT_FILL_X|LAYOUT_FILL_Y) setTarget(tgt) setSelector(sel) initEvents end def create super end def initEvents FXMAPFUNC(SEL_PAINT, 0, :onPaint) FXMAPFUNC(SEL_KEYPRESS, 0, :onKeyPress) FXMAPFUNC(SEL_COMMAND, ID_INPUT, :onAcceptInput) # That's the troublemaker FXMAPFUNC(SEL_MOTION, 0, :onMouseMove) FXMAPFUNC(SEL_CONFIGURE, 0, :onConfigure) FXMAPFUNC(SEL_CHANGED, FXWindow::ID_HSCROLLED, :onHorizontalScroll) FXMAPFUNC(SEL_CHANGED, FXWindow::ID_VSCROLLED, :onVerticalScroll) end def onMouseMove(sender, sel, event) puts "#{self.class}::onMouseMove" end end # Construction of an instance of CustomTable shopItems = CustomTable.new(border, nil, 0) Regards, Jannis From lyle at knology.net Thu May 19 08:33:05 2005 From: lyle at knology.net (Lyle Johnson) Date: Thu May 19 08:26:23 2005 Subject: [fxruby-users] FXScrollArea messages In-Reply-To: <428C7CC1.7010302@sten-net.de> References: <4288E03B.9040207@sten-net.de> <96e0d0a3b132a46c1482e12d36874489@knology.net> <428C7CC1.7010302@sten-net.de> Message-ID: On May 19, 2005, at 6:47 AM, Jannis Pohlmann wrote: > Here's my code, originally about 300 lines stripped down to what you > should need: Oh, I think I see it. It's the thing that I forgot to tell you about. ;) Try adding a call to enable() somewhere in there, in the initialize() method is as good a place as any: def initialize(parent, tgt, sel) super(parent, ...) self.target = tgt self.selector = sel initEvents enable # added this... end and see if that does the trick. Lyle From info at sten-net.de Thu May 19 08:45:43 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Thu May 19 08:44:41 2005 Subject: [fxruby-users] FXScrollArea messages In-Reply-To: References: <4288E03B.9040207@sten-net.de> <96e0d0a3b132a46c1482e12d36874489@knology.net> <428C7CC1.7010302@sten-net.de> Message-ID: <428C8A77.3020107@sten-net.de> Hey Lyle. > > On May 19, 2005, at 6:47 AM, Jannis Pohlmann wrote: > >> Here's my code, originally about 300 lines stripped down to what you >> should need: > > > > > Oh, I think I see it. It's the thing that I forgot to tell you about. ;) > > Try adding a call to enable() somewhere in there, in the initialize() > method is as good a place as any: > > def initialize(parent, tgt, sel) > super(parent, ...) > self.target = tgt > self.selector = sel > initEvents > enable # added this... > end > > and see if that does the trick. > > Lyle Indeed, it did! Thanks a lot, Lyle. - Jannis From info at sten-net.de Thu May 19 15:28:45 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Thu May 19 15:22:09 2005 Subject: [fxruby-users] Keeping child focused in FXTabBook (on key press) Message-ID: <428CE8ED.2000809@sten-net.de> Hi list, hi Lyle. I've got some problems here using a (now enabled, thanks to Lyle) FXScrollArea in a FXTabBook instance. When pressing the KEY_Up or KEY_Left the FXScrollArea looses its focus. Instead, the related FXTabItem gets focused. Usually, that's okay and I assume it is an intended behaviour. A topic that I couldn't find being discussed anywhere, neither on fxruby.org nor on the list (didn't I search hard enough?) was how to ignore those focus changes. I've browsed the FOX source once again. FXScrollArea is derived from FXComposite. This means that it sends SEL_KEYPRESS events to its target by default (or better, when begin enabled). And it sends SEL_FOCUS_UP to itself, handling it by itself. Hmmm, well, still, I didn't find the point which handler I'd have to overload/overwrite in order to ignore the message which leads to the focus change. I hope there's someone out there who has an idea. Kind regards, Jannis From info at sten-net.de Thu May 19 17:15:41 2005 From: info at sten-net.de (Jannis Pohlmann) Date: Thu May 19 17:14:43 2005 Subject: [fxruby-users] Keeping child focused in FXTabBook (on key press) In-Reply-To: <428CE8ED.2000809@sten-net.de> References: <428CE8ED.2000809@sten-net.de> Message-ID: <428D01FD.8060602@sten-net.de> Jannis Pohlmann schrieb: > Hi list, hi Lyle. > > I've got some problems here using a (now enabled, thanks to Lyle) > FXScrollArea in a FXTabBook > instance. > > When pressing the KEY_Up or KEY_Left the FXScrollArea looses its > focus. Instead, the related > FXTabItem gets focused. Usually, that's okay and I assume it is an > intended behaviour. > > A topic that I couldn't find being discussed anywhere, neither on > fxruby.org nor on the list (didn't > I search hard enough?) was how to ignore those focus changes. > > I've browsed the FOX source once again. FXScrollArea is derived from > FXComposite. This means > that it sends SEL_KEYPRESS events to its target by default (or better, > when begin enabled). > > And it sends SEL_FOCUS_UP to itself, handling it by itself. Hmmm, > well, still, I didn't find > the point which handler I'd have to overload/overwrite in order to > ignore the message which > leads to the focus change. > > I hope there's someone out there who has an idea. > > Kind regards, > Jannis I just found it out by myself: I had to write a FXMAPFUNC(SEL_KEYPRESS, 0, :onKeyPress) in my FXScrollArea subclass and add a return 1 statement into :onKeyPress. That's all. I found the solution in FXComposite::onKeyPress. - Jannis From vjoel at path.berkeley.edu Mon May 23 17:41:31 2005 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Mon May 23 17:34:47 2005 Subject: [fxruby-users] GP on Windows XP with threading In-Reply-To: <428B8C85.10907@usfamily.net> References: <428B8C85.10907@usfamily.net> Message-ID: <42924E0B.5070906@path.berkeley.edu> Steve Tuckner wrote: > Hello all, > > I have written a relatively small app that is a kind of IRB written in > Fox. You enter an expression into an edit box on one tab and then the > app switches to another tab to display the results. It also connects > using DRb server which contains an object that is part of the IRB's > binding (I don't use the IRB class in Ruby by the way). If my > expressions don't cause a DRb transaction to occur, then the application > doesn't crash. But if it does then I can crash the app (GP) by doing > 1-10 expressions involving the remote object. > > I am not really sure how to debug this issue further other than > isolating it which I am willing to do, but I am not sure what to isolate. Some very generic advice is all I can offer: the randomness of the problem suggests a GC-related bug--something is being collected but it is actually a live object. This is unfortunately something that happens from time to time with ruby extension programming (not just FXRuby). Try putting a "GC.disable" early in the app that is crashing. If that "fixes" it, then you can try isolating it by putting in some GC.start calls here and there and seeing when it crashes, and what objects were created before the last crash (logging the number of objects of each type using ObjectSpace_each_object may be useful, but be careful not to keep any extra references to those objects). I wish I knew a better way...