> > >> 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? > > > > > >gtk.CellEditable.editing_done > > > 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 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- > ComboBoxAndComboboxEntry.html#sec-ComboBox this is not anymore 100% accurate as for pygtk2.6 which has gtk.ComboBox.get_active_text def get_active_text() Returns : The currently active text. Note This method is available in PyGTK 2.6 and above. The get_active_text() method returns the currently active string or None if no entry is selected. Note that you can only use this function with combo boxes constructed with the gtk.combo_box_new_text() function. of course IIUC this combo_box_new_text() is not a what glade objects have done, so if you use glade you have to use that tip in the tut. it seems I need an ugly hack here. I'm not sure I understand completely what you said. If I have "changed" signal then everytime the user typing sth or selects from the combobox then it's emited. So I chech if text in entry is something from the list and execute on_go_button_clicked. That has some problems. Example user selects jabber.org form combo [so it goes there] [and adds 'jabber.org' in combo list] user then type jabber.orgA then removes A it will execute on_go_button_clicked and I for sure don't want that. Also my head hurts atm, so if I'm wrong or there's sth that works as it has to plz tell it Thank you ps. /me wonders how epiphany did it -- Nikos Kouremenos | Jabber ID: [EMAIL PROTECTED] | http://members.hellug.gr/nkour _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
