William B. Parsons
2009-Aug-29 21:18 UTC
[fxruby-users] elementary problem with LAYOUT_FILL
I''m sure this must be simple but I can''t seem to figure out
how to fill the
main window with widgets. The following bare-bones test app illustrates my
problem:
----------------------
#!/usr/bin/env ruby
require ''fox16''
include Fox
class TopLevelWindow < FXMainWindow
def initialize(app)
super(app, ''Test Application'', :width => 200, :height
=> 300)
FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL)
end
def create
super
show(PLACEMENT_SCREEN)
end
end
FXApp.new do |app|
TopLevelWindow.new(app)
app.create
app.run
end
----------------------
Why doesn''t the FXPacker fill the top-level window?
--
Will
William B. Parsons
2009-Aug-31 21:50 UTC
[fxruby-users] elementary problem with LAYOUT_FILL
On Sat, 29 Aug 2009 14:58:26 -0700 (PDT) dave L <dglnz at yahoo.com> wrote:> I haven''t used this control but think it''s a non visible control - I.E > it is something you don''t visually see but can access when used within > a window.But it is visible - since I passed a FRAME_SUNKEN attribute to the FXPacker you can see a small sunken square in the upper left-hand corner. Of course, in the real application I''m trying to build, the problem is that the widgets that get packed don''t fill the entire top-level window as I would like.> --- On Sun, 30/8/09, William B. Parsons <wbparsons at cshore.com> wrote: > > From: William B. Parsons <wbparsons at cshore.com> > Subject: [fxruby-users] elementary problem with LAYOUT_FILL > To: fxruby-users at rubyforge.org > Received: Sunday, 30 August, 2009, 9:18 AM > > I''m sure this must be simple but I can''t seem to figure out how to fill the > main window with widgets.? The following bare-bones test app illustrates my > problem: > ---------------------- > #!/usr/bin/env ruby > require ''fox16'' > include Fox > > class TopLevelWindow < FXMainWindow > ???def initialize(app) > ? ? ? super(app, ''Test Application'', :width => 200, :height => 300) > ? ? ? FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) > ???end > ???def create > ? ? ? super > ? ? ? show(PLACEMENT_SCREEN) > ???end > end > > FXApp.new do |app| > ???TopLevelWindow.new(app) > ???app.create > ???app.run > end > ---------------------- > Why doesn''t the FXPacker fill the top-level window? > > -- > Will > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > > >-- William B. Parsons <wbparsons at cshore.com>
On Sat, Aug 29, 2009 at 4:18 PM, William B. Parsons<wbparsons at cshore.com> wrote:> I''m sure this must be simple but I can''t seem to figure out how to fill the > main window with widgets. ?The following bare-bones test app illustrates my > problem: > ---------------------- > #!/usr/bin/env ruby > require ''fox16'' > include Fox > > class TopLevelWindow < FXMainWindow > ? def initialize(app) > ? ? ?super(app, ''Test Application'', :width => 200, :height => 300) > ? ? ?FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) > ? end > ? def create > ? ? ?super > ? ? ?show(PLACEMENT_SCREEN) > ? end > end > > FXApp.new do |app| > ? TopLevelWindow.new(app) > ? app.create > ? app.run > end > ---------------------- > Why doesn''t the FXPacker fill the top-level window?For some reason you''ve split out the construction options over two separate arguments. Trying changing this line: FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) to this: FXPacker.new(self, :opts => FRAME_SUNKEN | LAYOUT_FILL) Hope this helps, Lyle
William B. Parsons
2009-Aug-31 23:55 UTC
[fxruby-users] elementary problem with LAYOUT_FILL
On Mon, 31 Aug 2009 17:06:48 -0500 Lyle Johnson <lyle at lylejohnson.name> wrote:> On Sat, Aug 29, 2009 at 4:18 PM, William B. Parsons<wbparsons at cshore.com> wrote: > > > I''m sure this must be simple but I can''t seem to figure out how to fill the > > main window with widgets. ?The following bare-bones test app illustrates my > > problem: > > ---------------------- > > #!/usr/bin/env ruby > > require ''fox16'' > > include Fox > > > > class TopLevelWindow < FXMainWindow > > ? def initialize(app) > > ? ? ?super(app, ''Test Application'', :width => 200, :height => 300) > > ? ? ?FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) > > ? end > > ? def create > > ? ? ?super > > ? ? ?show(PLACEMENT_SCREEN) > > ? end > > end > > > > FXApp.new do |app| > > ? TopLevelWindow.new(app) > > ? app.create > > ? app.run > > end > > ---------------------- > > Why doesn''t the FXPacker fill the top-level window? > > For some reason you''ve split out the construction options over two > separate arguments. Trying changing this line: > > FXPacker.new(self, FRAME_SUNKEN, :opts => LAYOUT_FILL) > > to this: > > FXPacker.new(self, :opts => FRAME_SUNKEN | LAYOUT_FILL)Thanks! - that seems to have been the problem with my test app. (I''m still having issues with getting an FXTable to fill its alotted space, but I''ll poke around with the options a bit more before bothering the list.) -- Will