[fxruby-users] mdi vs. toplevel

Bob Sidebotham bob at windsong.bc.ca
Sat Oct 16 01:25:56 EDT 2004


Hi,

I'm currently using Fox 1.0.29. I understand that multiple top windows 
don't work in this version of Fox, so I'm playing with MDI for now, instead.

I would have expected that using an MDI child window would be very much 
like using a top level window. In fact, the placement options, 
initializer, etc. are all different. For example, when I use just a 
single main window (see the attached example mainwin.rb), the main 
window will size itself more-or-less perfectly to the size of the 
contained objects. If I use an mdi client window, however, I apparently 
must specify the size myself. As far as I can tell, there is no option 
to size this window based on requests from the widgets that are placed 
in there at the time the window is created (see attached example mdi.rb).

I'm supposing this is really a Fox issue (not an FxRuby issue), so 
please forgive me if this is the wrong place to post (I'd prefer to 
start here, since I'm using FxRuby, and Ruby people are just always 
friendlier :-).

My gut feeling is that I should give up on MDI and proceed to 1.2 and 
multiple top-levels. What do you guys say?

Thanks,
Bob Sidebotham


-------------- next part --------------
require 'fox'

include Fox

FXApp.new { |app|
  FXMainWindow.new(app, "World window") { |win|
    FXButton.new(win, "This is a rather long Hello, World!\non three lines\n(last one)")
    win.show
  }
  app.create
  app.run
}
-------------- next part --------------
require 'fox'

include Fox

FXApp.new { |app|
  FXMainWindow.new(app, "MDI Main Window", nil, nil, DECOR_ALL, 0, 0, 800, 600) { |main|
    FXMDIClient.new(main, LAYOUT_FILL_X|LAYOUT_FILL_Y) { |mdi|
      FXMDIChild.new(mdi, "World window", nil, nil, 0, 10, 10, 400, 300) { |win|
	FXButton.new(win, "This is a rather long Hello, World!\non three lines\n(last one)")
      }
    }
    main.show
  }
  app.create
  app.run
}


More information about the fxruby-users mailing list