Re: Setting the height of a GtkText object?
| From: | Steph | Date: | Mon, 28 Jan 2002 01:57:54 +0000 |
| Subject: | Re: Setting the height of a GtkText object? | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1048@lists.php.net to get a copy of this message | ||
Don't know how helpful this is, but I've found that the default win32 text is a 16 pixel
text and that the lines thereof are all 16 pixels high. If you don't want the default use
GtkFontSelectionDialog('needs label but no window') which will give you the terms you need
to set a font using gdk::font_set(), to the letter and by pixel-size if you ask it nicely. If you
leave the text widget to set its own default size it will give you 10 lines. If you don't,
you'll need to set_usize() on the parent window.. NOT anything between, it has to be the object
at the bottom *or* the object at the top or the packing hierarchy that has usize set.
Boxes are pretty well covered in the PHP-GTK docs for sizing issues now. If the window holding the
box is usized, that sorts out the problem, taken in tandem with the box packings.
A GtkScrolledWindow is either the child of a window or of a box container. Same applies.
Think of those Russian dolls with a smaller doll inside, and a smaller doll inside, and a smaller
doll inside ... it's a bit like that. If the outer doll's too big the whole thing
rattles, if it's too small the idea doesn't work. They have to be sized to fit one
another, and that sizing rule can be from either end, by asking the toplevel window (big doll) to
fit around whatever it holds or by asking the smallest of the contained objects (peas) to expand to
fit to the set size of the ancestors.
HTH, or even makes sense -
Steph
----- Original Message -----
From: "Andy Chase" <monkey@greyledge.net>
To: <php-gtk-general@lists.php.net>
Sent: Monday, January 28, 2002 1:11 AM
Subject: [PHP-GTK] Setting the height of a GtkText object?
> Hi everyone,
>
> I've spent the better part of the last couple of hours searching the PHP-GTK
> docs, list archives, and Google on this one, and I'm stumped:
>
> How do I go about explicitly setting the height of a GtkText object or its
> container (For instance, a GtkScrolledWindow or GtkHBox), either in terms of
> # of lines of text, or # of pixels? I don't see any methods in GtkText or
> any of its parents that look like they would accomplish this, but this seems
> like it would be something most developers would want to do with their GUIs.
>
> Am I missing something obvious? (This is entirely possible, since I've only
> been playing with PHP-GTK for about four days, and I've never done GUI
> programming before.) Do GtkAdjustment objects have something to do with it?
>
> I appreciate any tips anyone might have!
>
> Thanks,
>
> -Andy
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, e-mail: php-gtk-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-gtk-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>