Re: How to set "character" width of GtkEntry widget?

From: Date: Thu, 24 Apr 2003 16:01:20 +0000
Subject: Re: How to set "character" width of GtkEntry widget?
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-3273@lists.php.net to get a copy of this message
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 >

« previous php.gtk.general (#3273) next »