Re: How to set "character" width of GtkEntry widget?
| From: | Philip Hallstrom | Date: | Thu, 24 Apr 2003 15:06:23 +0000 |
| Subject: | Re: How to set "character" width of GtkEntry widget? | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3274@lists.php.net to get a copy of this message | ||
Steph -
Thanks for the info... I'm on windows so I don't think that font
will work for me, but your last sentence regarding the width of the widget
is controlled by the way it's packed just means I need to redo my packing
(various GtkBoxes, right?) in order to "scrunch" it down?
I am interested only in width. What would be ideal is:
$entry->set_character_width(5);
which would make it wide enough to display 5 characters in whatever the
font already specified was.
I'll work on the packing stuff...
Thanks!
-philip
On Thu, 24 Apr 2003, Steph wrote:
> Hi Philip,
>
> I'm having trouble working out whether it's height or width you're
> discussing here ..
>
> The height of the widget is set by the height of the font. Try this:
>
> <?
> $window = &new GtkWindow();
> $window->connect_object('destroy', array('gtk', 'main_quit'));
>
> $entry = &new GtkEntry();
> $entry->set_max_length(10);
> $font =
> gdk::font_load('-adobe-courier-bold-r-normal-*-6-*-*-*-m-*-iso8859-1');
> $style = $entry->style;
> $style->font = $font;
> $window->add($entry);
>
> $window->show_all();
> gtk::main();
> ?>
>
> Then try with the fontsize at 36 instead of 6.
>
> The width of the widget is generally controlled by the way it's packed..
>
> > Hi -
> > I'm just starting out with gtk-php and am muddling my way through
> > some things. I'd dig through the apps up on the website, but it's
> broken
> > at the moment...
> >
> > One thing I can't figure out is how to make a narrow GtkEntry widget.
> I
> > know I can do use set_usize(), but that's in pixels and it seems like
> the
> > wrong way to make a narrow widget???
> >
> > What I'm looking for is the equivalent of the SIZE attribute in HTML
> for
> > "<input type=text name='foo' size=5>"?
> >
> > Does that exist? If it doesn't, is the height of a GtkEntry *always*
> the
> > same (since there is no way to set one and not the other)???
> >
> > Thanks all!
> >
> > -philip
> >
> > --
> > PHP-GTK General Mailing List (http://gtk.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>