From: Lyle Johnson Date: 2003-03-19T09:12:53+09:00 Subject: Re: [FXRUBY] FXProgressBar and SEL_COMMAND Pierre Baillet wrote: > Is it possible to hook a method on a progressbar so as to get an event > when the users clicks on it? Yes. An FXProgressBar is usually just used for display purposes (like a label) and so it's not normally enabled for user events. In order to get messages for mouse clicks, then, you first need to enable it: aProgressBar.enable After that, you can "listen" for, say, the SEL_LEFTBUTTONRELEASE message, aProgressBar.connect(SEL_LEFTBUTTONRELEASE) { puts "Click!" } > How can i proceed if i want to run from my FXMainWindow another > FXMainWindow ? This doesn't look to be possible at all. True; FOX 1.2 will support multiple main windows in an application, but FOX 1.0 does not. > So I suppose my base window must extend another FXWindow class. > Which one is as easy to use as the FXMainWindow? You might try subclassing FXDialogBox. Like FXMainWindow, it is derived from FXTopWindow (the base class for all top-level windows). > My application is an image browser and, at some point, i'd like to > re-intance another intance of my application with a slightly different > constructor to allow the user to select an image. I'd like to avoid > rewriting most of my image browser... This doesn't sound like something that warrants instantiating a whole new main window object, but of course I guess it depends on how the application is structured. For the dialog box (or whatever it is) that the user interacts with to select a new image, is it that you're trying to provide some kind of "preview" of the image to be loaded? Can't you just embed an FXImageView widget in there somehow? Please take a look at the imageview.rb example program for an idea of how to use the FXImageView widget, it's pretty easy. Hope this helps, Lyle