Box packing

Olivier Andrieu oandrieu at nerim.net
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:

Right:

- 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.

Cheers
-- 
   Olivier
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: b.ml
URL: <http://lists.ocamlcore.org/pipermail/lablgtk-list/attachments/20060322/739fb150/attachment.txt>


More information about the Lablgtk-list mailing list