Re: Question on layout basics ...
| From: | Madeleine D. | Date: | Tue, 21 Mar 2006 19:54:10 +0000 |
| Subject: | Re: Question on layout basics ... | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6803@lists.php.net to get a copy of this message | ||
Miles -
Sorry, I got tied up in a crisis and didn't check the list until this morning... And I know everybody else is all caught up in Gtk2 - hence the minimal list traffic.
As I mentioned before, I'm not a glade user, so I can only point you to samples on that one. I'd check out Christian's File Dialog or the Theme package. I believe both are now based on glade XML files.
You look to be on the right track as far as packing boxes. There's no real fixed way to do things - just whatever it takes to get the look you're after.
I tend to use the following template on our screens - just something that's worked for us in terms of layout and dynamic behavior. Starting at the top:
GtkWindow packed with
GtkVPane packed with (1) GtkStatusBar, set to fixed, for info/help messages
and
(2) GtkVBox, set to resize and packed with GtkHBox packed with
GtkFrame packed with any combination of the following:
GtkVBoxes packed with
GtkLabels, GtkEntrys (various fixed/resized)
and/or
GtkHBoxes packed with
GtkCLists or GtkScrollWindows set to resize
and/or
GtkHButtonBoxes or GtkVButtonBoxes, usually fixed and packed with
GtkButtons
The above gives us the right amount of flexibility in terms of layout and behavior. In fact, we find the more you combine boxes, the more flexibility you get - even though it sometimes feels like overkill.
Hope that helps.
Madeleine D.
Miles Thompson wrote:
Madeleine, No, I didn't, so if I'm on the right track it would be nice to know. I have decided to not use Christian Weiske's AppWizard, but to call the GladeXML constructor directly, like so ...$glade = &new GladeXML( dirname( __FILE__) . "/basichelp.glade");although I've not quite figured out how this will work with multiple windows in a project. <g> I could make each window it's own .glade file and instantiate each separately. Thank you for keeping an eye out for me. Tks - Miles PS Has there been any traffic on the list? I've seen nothing. /mt At 01:48 PM 3/21/2006, you wrote:Miles - Did you get any replies on this? Madeleine D. Miles Thompson wrote:This is v. much a new-to-GTK+PHP question. Please confirm, or correct if the following layout assumptions are correct. I need:dynamically resizeable list, set of 4 fields with labels to hold data that can added/edited, and row of buttons for add / edit / save / delete.Using wGlade, I'm pretty certain this is the procedure to follow: Create new window Insert a GtkVBox - call it holdallInsert GtkHButtonBox, with 4 buttons, into holdallInsert a GtkTable above the button box into holdall. 5 columns, two rows In the cells of the first column insert the GtkLabels for the entry fields In the cell of second column insert the GTKEntry fields skip the middle column or insert a bit of space Repeat for fourth & fifth columnsInsert another GtkVBox into holdall, above the table box Insert a GtkCList in this vBoxTo keep the row of buttons, I set them to non-expandable Same thing for the table? Now, if I resize the box, the GtkCList should expand, and everything else stays the same size? When I tried the first vBox with three rows, I had no practical control over the automatic re-sizing of the row containing the fields. That's why I think a stack of boxes is the way to go. Now, after all this is done, then I add the tags, etc. for the functions I want to happen, save, then process the Glade file using Christian Weiske's AppWizard to generate the basic PHP framework. Or is there a better way? Advice and suggestion are most welcome. Regards - Miles Thompson