Re: GtkCombo, GtkEntry question

From: Date: Tue, 28 Jun 2005 22:29:25 +0000
Subject: Re: GtkCombo, GtkEntry question
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5904@lists.php.net to get a copy of this message
On Tuesday 28 June 2005 14:14, Madeleine D. wrote: > Ben - > Can you clarify a little what you're trying to achieve here? You can set > the combo box so it the content can't be changed, but I'm not sure if that > is the same thing as what you're after. I have a list of options available to users for a particular account. Depending on the type of account being viewed, the options may be user-selectable, or determined by a database on another server. I've not yet come up with a way to say that a GtkCombo widget (which may contain N options) may not be changed, unless I'm just missing something fundamental. The only thing I've seen so far is to take the GtkEntry property out of the GtkCombo and $entry->Set_Editable(false); but this still allows the user to select other options on the list. Since there's callback code that requires a GtkCombo widget along with the values of list N that I'd rather not have to audit, I figured I could pull the entry property out of GtkCombo and display it, instead of the full GtkCombo widget - but it seems that's not in the cards. Is there a way to say that a GtkCombo widget, containing list N, and set to value Y cannot be changed? Pseudo: $combo=&NewGtkCombo(); $combo->Set_Popdown_Strings($N); $entry=$combo->entry; $entry->Set_Editable(false); $entry->Set_Text($N[$i]); # this is where it gets interesting: $combo->Set_User_Selectable(false); ..... -Ben > At 01:24 PM 6/28/05 -0700, Benjamin Smith wrote: > >Why doesn't this code work as expected? > > > >I'm expecting to see a window with a GtkEntry widget in the middle - but the > >GtkEntry widget seems to be a no-show. It works fine if I put the Combo into > >$win, but I want to just put the $entry widget... > > > ><? > >$combo=&New GtkCombo(); > >$entry=$combo->entry; > >$entry->Set_Text('foo'); > > > >$win=&New GtkWindow(); > >$win->Set_Usize(200, 200); > >$win->Add($entry); > >$win->Show_All(); > >?> > > > >(The reason is that I have a selection list that people can choose from, > >unless the record wasn't manually entered. Then, I want to populate the > field > >from the database, and make it so you can't change the GtkCombo widget. > Since > >there appears to be no method in GtkCombo() to do that, I'd like to just > >display the GtkEntry widget, without breaking other callbacks that depend on > >the GtkCombo widget) > > > >-Ben > >-- > >"The best way to predict the future is to invent it." > >- XEROX PARC slogan, circa 1978 > > > >-- > >PHP-GTK General Mailing List (http://gtk.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- "The best way to predict the future is to invent it." - XEROX PARC slogan, circa 1978

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