Fwd: [PHP-GTK] GtkCombo, GtkEntry question

From: Date: Tue, 28 Jun 2005 22:52:55 +0000
Subject: Fwd: [PHP-GTK] GtkCombo, GtkEntry question
References: 1 2 3  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5906@lists.php.net to get a copy of this message
---------- Forwarded message ---------- From: Malk0 <malk0.phpgtk@gmail.com> Date: 28 juin 2005 23:46 Subject: Re: [PHP-GTK] GtkCombo, GtkEntry question To: "Madeleine D." <mmdrake@bctonline.com> Hi ben, the problem is that the entry is already contained in the gtkcombo. you have 2 solutions but as madeleine i'm not sure that the second sweet you needs. first way: remove the entry from it's actual parent: <?php $combo=&New GtkCombo(); $combo->set_popdown_strings(array('a','b','c')); $entry = $combo->entry; $combo->remove($entry); $entry->Set_Text('foo'); $win=&New GtkWindow(); $win->Set_Usize(200, 200); $win->Add($entry); $win->Show_All(); gtk::main(); ?> but you still can edit the content but perhaps that's what you want, don't know. in an other hand if you want to get it uneditable at all you can add the combo to the window as always and simply set it insensitive: <?php $combo=&New GtkCombo(); $combo->set_popdown_strings(array('a','b','c')); $combo->set_sensitive(FALSE); $entry = $combo->entry; $entry->Set_Text('foo'); $win=&New GtkWindow(); $win->Set_Usize(200, 200); $win->Add($combo); $win->Show_All(); gtk::main(); ?> hope this will help, nathan 2005/6/28, Madeleine D. <mmdrake@bctonline.com>: > Ben - > > I don't believe you can do this. The $entry is not a separate widget, but > the entry property of the combo widget. As such, it's not an object to be > added anywhere. > > 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. > > Madeleine D. > > > 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 > >

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