Re: coding UI v.s. drawing UI
| From: | Alan Knowles | Date: | Fri, 08 Mar 2002 02:55:47 +0000 |
| Subject: | Re: coding UI v.s. drawing UI | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1478@lists.php.net to get a copy of this message | ||
JSheble wrote:
One of the reason I'm having such difficulty is I originally come from a VB background... so when I visually design my VB forms, I have come to expect certain things... When I change the size of my form (window) the width and height properties update automatically. This doesn't happen in Glade. In VB I can place controls precisely where I want them, and while I can do this in Glade with the FIxed Position widget but then resizng the window becomes difficult. If I use the horizontal and/or vertical box widgets, I have a hard time setting the size of some of the controls I place. Could this just be my Glade in-experience, or are they really this difficult to size properly?Getting used to Glade and Gtk's layout ideas does take a little while, although you can 'hard code locations etc. in the common tab, this usually leads to 2 problems - if a window is resized, you can get very unexpected results. - you have to remember (as I often forget) that people dont all have monitors that are 1600x1200 :) The glade/gtk layout method is more like html tables, in that it is designed in a way that it is expected that the user will resize stuff.. There are various controls that can help, - the Packing tab helps you decide if an object can expand, and in which direction. - the common allows you to set minimum sizes - the widget tree (view->show widget tree), is essential for navigating large files. - right mouse button - does alot of wierd and wonderfull stuff! you can also break up layouts into multiple files - eg. phpmole uses 1 glade file for each of the modules/editors etc. - yet displays them on one window. according to the docs this can be done something like $glade = &new GladeXML("file","my_interface_hbox"); and then doing $box = $glade->get_widget("my_interface_hbox"); $gtkwindow->add($box); (phpmole does it by loading all, and removing then adding - as I discovered the above after reading alot of the glade API). In general, once you get your head around the glade layout stuff, it will save alot of time... however, actually learning php-gtk it is very usefull to know how the individual widgets are combined, so there is a benefit in 'doing it the hard way' first anyway.. hope this helps regards alan
At 05:10 PM 3/7/2002 +0100, Sebastian G. wrote:Steph wrote:I find it harder work using Glade. But it does seem to have a lotof fans. "JSheble" <justformailinglists@wizaerd.com>: I'm just curious as to how many people code their UI as opposed to using Glade to visually draw out their UI... I've been trying to use Glade, but it's become increasingly irritating and frustrating to use... There are many things that just don't seem to 'work' well, but it could also be my in-experience as well... but coding a UI sure seems to be a huge task... this is why I was curious as to other peoples preference.. Hi, well, if you ask me, I would _die_ having to code my 600 lines of XML by hand in phpGtk...! I think it's cool to do the widgets in glade, then just pick a widget in phpGtk and define signals and handles for it... And it works well for me, though... Sebastian G. mailseppel@gmx.de