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

From: Date: Thu, 24 Apr 2003 21:18:31 +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-3279@lists.php.net to get a copy of this message
Philip - You're right - we just grabbed the closest number. For our font, it turned out to 24 - typical field was $name->set_usize(250,24). Then when we changed to a gtkrc with a smaller font, we had to shift it to 21. Not a big deal and it came right on the money for us both times - no partial lineups with labels, etc. I'm sure you're also right, in that you should be able to grab the height from somewhere, but we couldn't find it. There isn't a get_usize or get_size. We have used '$widget->style' on a couple of elements to reset colors and fonts, but there's no height there either. And yes, the packing stuff is way-different compared to HTML. We've had to spend a lot of time and hassle getting our former HTML screens to look the way we want. Also, I think an HTML 'select' is much easier and more user-friendly than a GtkCombo. On the other hand, we're getting the multi-platform/web capabilites we need, so we're willing to swallow the time. Let me know if you find an answer on the height. thanks, Madeleine D. At 01:03 PM 4/24/2003 -0700, you wrote: >It does, but how did you know what to set for the height part of >set_usize? Or did you just set it to something close and not worry >about it? > >I haven't looked, but if there's a get_usize then I could just use it's >height value and be done with it. > >I think I just need to play around more with the packing stuff... very >different from the <table>'s of html :) > >thanks! > >-philip > >On Thu, 24 Apr 2003, Madeleine D. wrote: > >> Philip - >> >> I think you're going through the same path I just took as a newbie. >> >> We needed to make the fields more reflective of the actual data; i.e., 1/4 >> inch for state, 1/2 for zip, etc. What we used 'size' for in HTML. >> >> What we ended up doing was 'set_usize' on the fields in question, and then >> packing them first into GtkHBoxes with pack_start(FALSE,FALSE,0) to prevent >> them from filling the space and then into a second GtkHBox together with >> their label, also with FALSE settings. >> >> It seems a bit confusing at first, but it was the only way we could prevent >> what seems to be Gtk's natural bent to fill a given area. >> >> Hope that helps. >> Madeleine D. >> >> >> >> >> At 09:30 PM 4/23/2003 -0700, you wrote: >> >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 (#3279) next »