[Glade-users] hello there



On Fri, 9 Feb 2001, Michael wrote:

      For example , I create a window and if i put a checkbox , it will take
whole space of the window . How can I limit its space and position
(x,y,w,h)?

Michael, when creating a dialog box in GTK+, it is quite rare that you
specify the exact dimensions of a control.  Rather, controls are usually
placed relative to each other, in an invisible "packing" widget.  For
example, three packing widgets I commonly use are the vbox, the hbox, and
the table widgets.  The vbox and hbox widgets simply divide the area they
occupy into a number of vertically or horizontally adjacent subareas.
There are properties for the v/hbox widgets to specify padding,
homogeneosity, and so on.  The table widget is similar, but divides its
area into a table of cells.

This makes it quite difficult from a Windows programmer's perspective,
because Windows does not have this sort of system, choosing instead to use
fixed placement.  There are various reasons why fixed placement isn't a
terribly good idea, but I won't go into them here, since it's tangential
to your problem.

One of the packing widgets provided is the GtkFixed widget, that provides
for fixed (x,y,w,h) dimensions.  This will probably allow you to
automatically convert your dialog boxes, but be warned that the end result
is likely to look wrong, due to differences in relative widget sizes,
fonts, and any effect themes may have.

      For example , a dialog with 20 controls couldn't be ported ,because each
time i could only add one widget to the main window .

Windows are based on GtkContainer widgets, which are packing widgets that
simply contain one other widget.

      TurboIRC cotains about 100 dialox boxes , and it will be hard to port them
manually , I plan to create a small console program that reads the RC file
 the Windows resource script ) and converts it to Glade format . But to do
that I need to create at least one dialog with Glade and see its format .

Try a GtkFixed inserted into the toplevel window, and add a control or two
to that.

-- 
bje






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]