From: Lyle Johnson Date: 2002-06-10T23:18:46+09:00 Subject: Re: FXRuby: how to open a second window? > I'm using FXRuby (Thanks Lyle for the good work) and my toy application > creates a mainWindow with a Menu bar. On of this Menu item is in charge > of opening a second window (not a dialog box or something-box but a real > second window) and I couldn't find how to do that.... I'm not sure if I understand the question, but if you're just wanting to display a second main window you could do this: menuItem = FXMenuCommand.new(aMenu, "Show another main window") menuItem.connect(SEL_COMMAND) { mainWindow2 = FXMainWindow.new(app, "Main Window #2") mainWindow2.create mainWindow2.show } In addition to dialog boxes (which you already know about), yet another kind of top-level window is a popup, which is what we use for tooltips, menu panes, etc. > My problem is basically that FXWindow.new expect a FXComposite object as > its first argument. I thought passing the root window of the running > application as the first argument to FXWindow.new would do (since > FXRootWindow inherits from FXComposite) but it fails miserably... Yes. Although FXWindow is technically not an abstract class (i.e. you *can* instantiate one of them), it's really meant to serve as a base class for more interesting kinds of windows ;) > I already feel stupid just thinking about the obvious answers that you > will all soon be posted :-/ If it wasn't obvious it wasn't a stupid question. It doesn't come up a lot (or hasn't yet, at any rate), but FOX does allow for multiple top-level windows. Hope this helps, Lyle