[fxruby-users] Scrollbars and Layout sizes

Jannis Pohlmann info at sten-net.de
Thu Jun 30 08:50:53 EDT 2005


Damphyr schrieb:

> Well,
> I'm trying to put together a quick gui for a log analysis script I'm 
> using and while I've got the basics working it just doesn't look the 
> way I want it to :).
> Being an absolute newbie in the subject of FOX and a relative stranger 
> to GUI programming in general I need help badly.
> Now, my current problem is getting a FXList to start with a reasonable 
> size. The following code does not do what I expect it to do (multiple 
> select is not activated).
>
> #List for types
> theTypeList=FXList.new(topFrame,nil,LIST_MULTIPLESELECT)
> types.each{|t|
>     theTypeList.appendItem(t)
> }
>
> Moreover I get only two visible items (there are more the 10) 

Try:

    theTypeList.numVisible = types.size # or any integer value you'd 
like to use

If you're creating theTypeList at runtime you will have to call

    theTypeList.recalc

afterwards.

> and a very narrow horizontal area (something like 5 characters wide). 
> How do I control initial size for the widget? How to I make it resize 
> together with the outer window?

Try adding LAYOUT_FILL_X and/or LAYOUT_FILL_Y as additional flags in the 
call of FXList.new (e.g. LIST_MULTIPLESELECT|LAYOUT_FILL_X).

> topFrame is a FXHorizontalFrame with default initialisation.
> I'd appreciate a few pointers to tutorials for Layouts and Layout 
> hints if there are any out there. I've looked in FXruby.org and FOX 
> Community, but there doesn't seem to be much about the nitty gritty of 
> layouts.

The best page for information about layout managers is this one 
(included in the FOX docs):
http://fox-toolkit.org/layout.html

- Jannis


More information about the fxruby-users mailing list