Box packing

Olivier Andrieu oandrieu at
Wed Mar 22 11:54:15 CET 2006

 Erik de Castro Lopo [Wednesday 22 March 2006] :
 > Erik de Castro Lopo wrote:
 > > Hi all,
 > > 
 > > Some time ago I did some coding with the GTK+ widgets in C. I am
 > > now trying to do something an Ocaml and I'm not finding it any
 > > easier than it was in C :-).
 > > 
 > > I'm basically trying to construct something like a text editor
 > > with a menubar at the top, a text are in the middle and scroll
 > > bars to the right and bottom.
 > Here's the code:


- don't use #add for packing in boxes, you can't control the options:
  #add happens to use expand:true and fill:true, you usually don't want
  that for a menubar. Use #pack instead.

- use the GBin.scrolled_window for adding scrollbars, it takes care of
  all the packing, connecting, etc. of your widget

Updated code in attachment.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
URL: <>

More information about the Lablgtk-list mailing list