[pygtk] comboboxentry changed is not enough
smcclure at racemi.com
Wed Mar 30 00:58:27 WST 2005
On Tue, 2005-03-29 at 18:40 +0200, Marcus Habermehl wrote:
> Nikos Kouremenos schrieb:
> >On Tue, 29 Mar 2005 07:20:31 +0200, Marcus Habermehl <bmh1980de at yahoo.de> wrote:
> >> Nikos Kouremenos schrieb:
> >> >I want to have comboboxentry do what firefox and epiphany location comboboxentry does.
> >> >So I need when the user selects a previous visited site, to have an event for that. The only thing I found was changed
> >> >but that's not good cause it's emited on just typing a character in the entry too!
> >> >now I know that I can (ugly) workaround this by checking if given text by the emission even is one of those in listed in comboboxentry but that's too ugly and too many emissions of events.
> >> >I cannot believe that GTK lacks such a signal. ML help :)
> >> I'm not sure (/me isn't a genius with Python ;)). What's about the
> >> editing_done signal of the comboboxentry?
> > def editing_done()
> >The editing_done() method emits the "editing_done" signal that
> >notifies the cell renderer to update it's value from the cell.
> >If that's what I need then I don't know how to use it [when and how
> >should I call editing_done()?] and we're talking about
> >comboboxentry.child and I'm not sure this solves my problem.
> I have searching in Glade. But i don't know how it is working, too. :(
> If you save the inserted strings in a list you can check on changed if
> the string is in the list. You know waht I mean?
> Because of I have never working with gtk.ComboBoxEntry I doesn't have
> experience with this widget. I only have use gtk.ComboBox with Gtk+ < 2.4.
> Sorry. I'm not a big help. :(
I almost exclusively use 1.2 but in that version you could use
combobox.list.get_selection() which would return an empty list if
nothing in the list was selected. You would have to check that on every
keystroke though which you've discovered by using the changed signal.
It looks like in 2.x you'll have to do the same thing with the
ComboBoxEntry widget using the same signal and the get_active() method.
That part is in the FAQ: http://pygtk.org/pygtk2tutorial/sec-
> pygtk mailing list pygtk at daa.com.au
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Steve McClure Racemi
email: smcclure at racemi.com 75 5th St NE
voice: 404-892-5850 Suite 333
fax: 404-892-7215 Atlanta, GA 30308
More information about the pygtk