Re: Search in ComboBox

It is possible, but as Murray said -- it doesn't make much sense. What would be cool finally, is if we could get the regular ComboBox dropdown act as the completion for a ComoboBoxEntry, something I wanted to be able to use for a while now.

2008/6/4 Martin (OpenGeoMap) <martin opengeomap org>:
I think it´s no possible use autocompeltation with comboboxentry.


Martin (OPENGeoMap) wrote:
What about a gtk entry with  autocompletion?
Hi Martin!
Here in python a complete sample using autocompletion:

  entry = gtk.Entry()
  completion = gtk.EntryCompletion()
  liststore = gtk.ListStore(gobject.TYPE_STRING, gtk.gdk.Pixbuf)
  pixbufcell = gtk.CellRendererPixbuf()
  completion.add_attribute(pixbufcell, 'pixbuf', 1)
  # create a gtk.CellRendererText and pack it in the completion. Also set
  # 'text' attribute
  # load up the liststore with string - pixbuf data - assuming pixbuf

the same for ruby/gnome, monogtk#, gtkmm, gtk, etc,..
  liststore.append(['string text', pixbuf])

You need a entry and also the EntryCompletion class. The widget you can 
see is the gtk::entry

Hi there

I'm trying to do that same thing, but using a comboboxentry, wich gets the
list from a DB.

This is my code and it gets the values from the DB and show them as a
combolist, but I have
no idea of how to add that autocomplete function to that. This is my code so

	widget = "combo_widget" # "combo widget" is a comboboxenty and I0m using
glade to create it.
	self.combo = self.xml.get_widget(widget)

	self.c.execute("SELECT column FROM table")
	list = self.c.fetchall()
	for values in list:
		self.combo.append_text('%s' % values[0])


gtkmm-list mailing list
gtkmm-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]