Re: EuGTK: notebook control stuff
- Posted by irv Jul 12, 2012
- 4437 views
To answer the first question re: setting the size and position of controls:
Basically, you don't.
Size of controls is best left up to the window manager, since different users have differing needs and preferences. Similar to the way the appearance is left up to the user to adjust, using themes, etc. You normally have the option to tell GTK to either expand the control to take up all available space, or to not expand. See packing in the GTK docs.
Position, similarly, doesn't often use set locations. Instead, GTK uses a packing scheme, where controls are packed into one or more containers. There are just a few kinds of containers, the one you will use most is the GtkBox. When creating a box, you can choose either vertical: <create(GtkBox,1)> or horizontal: <create(GtkBox,0)>
From there, any controls you add to or pack into the box are simply placed below (or to the right) of the previous control.
For fancier layouts, you can either add containers to a parent container to arrange things the way you want, or you can use a grid, where things can be attached 'next to' other things. Look at test34.ex.
Positioning things in a fixed x,y manner is frowned upon.
Now, for the other:
To make the notebook fill the window, change add(panel,notebook) to pack(panel,notebook,TRUE,TRUE) the 2 trues mean EXPAND and FILL
To make the window automatically fill the available screen space on startup, add a line: set(win,"maximize",TRUE).
BTW, I just uploaded a new version to https://sites.google.com/site/euphoriagtk/ which has several bug fixes. Version 4.6.02 has been tested on both 32 and 64 bit machines, with several different Linux distros.