> Thanks for the replies. I didn't really get the "get" thing > you mentioned. I tried the grab(this) and even > grab(this->window()) but neither did what I expected. As you > mentioned, it is quite dangerous and all I ended up with were > non-responsive widgets :(
Yes, do not use grab(), it has a very few specific applications, none of which should be relevant here. Forget it even exists! > So, back to the problem. A few more details on my subwindows: > I have several "classes" that inherit from Fl_Double_Window. > Each of theses classes have widgets (buttons, boxes, etc). I > create 1 object for each class and add them to my main window: > > // Global > Fl_Double_Window MainWin(0, 12, ScreenWidth-6, > ScreenHeight-62, "Robotic Simulation"); > FwdKinematics* FKMenu = new > FwdKinematics((int)(ScreenWidth*.12), (int)(ScreenHeight*.12)); In what sense are these "global"? If you "new" a widget *of any sort* it will be automatically added to the last valid window, so if this is literally what your code looks like you are probably creating a series of nested windows, which is *not* going to be what you want. Unless you *specifically* want to nest your windows (and I think you do not) then you *must* end the previous window before "new"ing the next one... Viz: MainWin->end(); FwdKinematics* FKMenu = new FwdKinematics(....) etc. > // Inside a "Set GUI" func > MainWin.add(FKMenu); > MainWin.add(FKPopDH); > MainWin.add(IKMenu); Why are you adding the windows to the main win? I thought you wanted these as free floating widgets, so they should be top level windows in their own right, *not* children of a main window. Menu windows, or modal windows (of either sort) or subwindows might be added as children of a top-level window, but free floating tool windows are top-level windows in their own right and should NOT be added to the parent like this. > With the "show" method I can make one window appear on top of > the other but the one that gets all the clicks is the last > one added to MainWin. That's odd. Might be related to some of the points above. > The first time I show a subwindow I have to use show twice... > (if it works, don't touch it!). Could that be causing the trouble? Yes. That should not happen. As a general tip, if something odd happens, try and figure out why. Working round it probably masks all manner of nasty little bugs... > // Unrelated: > Is there a method in FLTK to get the screen resolution and > fill those ScreenWidth and ScreenHeight variables? Yes. Fl::w() and Fl::h() will return the width and height of the current screen. If you have a multi-head setup, you probably need to look into the Fl::screen_count() and Fl::screen_xywh() methods. SELEX Sensors and Airborne Systems Limited Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England & Wales. Company no. 02426132 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

