elementary problem with LAYOUT_FILL

View: New views
5 Messages — Rating Filter:   Alert me  

elementary problem with LAYOUT_FILL

by Will Parsons-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: elementary problem with LAYOUT_FILL

by dglnz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi William,

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.

Think of it like a Timer control where you've given the user a set period of time to respond but you don't want a counter to be visible so you user Timer set it's timeout value and when started counts to the timeout value then it calls some sort of default action.

I do stand to be corrected on this as i am new to FXruby too.

dave.

--- On Sun, 30/8/09, William B. Parsons <wbparsons@...> wrote:

From: William B. Parsons <wbparsons@...>
Subject: [fxruby-users] elementary problem with LAYOUT_FILL
To: fxruby-users@...
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@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Email slow, clunky, unreliable? Switch to Yahoo!Xtra Mail, New Zealand's new email address.
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: elementary problem with LAYOUT_FILL

by Will Parsons-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 29 Aug 2009 14:58:26 -0700 (PDT)
dave L <dglnz@...> 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@...> wrote:
>
> From: William B. Parsons <wbparsons@...>
> Subject: [fxruby-users] elementary problem with LAYOUT_FILL
> To: fxruby-users@...
> 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@...
> http://rubyforge.org/mailman/listinfo/fxruby-users
>
>
>
>      


--
William B. Parsons <wbparsons@...>
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: elementary problem with LAYOUT_FILL

by Lyle Johnson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Aug 29, 2009 at 4:18 PM, William B. Parsons<wbparsons@...> 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
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: elementary problem with LAYOUT_FILL

by Will Parsons-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 31 Aug 2009 17:06:48 -0500
Lyle Johnson <lyle@...> wrote:

> On Sat, Aug 29, 2009 at 4:18 PM, William B. Parsons<wbparsons@...> 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
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users