def testPopup(self): entry = ComboEntry() win = Gtk.Window() win.add(entry) win.show_all() entry.hide() entry.popup() entry.popdown()
def main(args): w = Gtk.Window() w.set_position(Gtk.WindowPosition.CENTER) w.set_size_request(250, -1) w.set_title('ComboEntry example') w.connect('delete-event', Gtk.main_quit) e = ComboEntry() e.prefill([ 'foo', 'bar', 'baz', 'biz', 'boz', 'bsz', 'byz', 'kus', 'kaz', 'kes', 'buz', 'bwq', 'uys' ]) w.add(e) w.show_all() Gtk.main()
data = (Person('Evandro', 23, 'Belo Horizonte'), Person('Daniel', 22, 'São Carlos'), Person('Henrique', 21, 'São Carlos'), Person('Gustavo', 23, 'São Jose do Santos'), Person('Johan', 23, 'Göteborg'), Person('Lorenzo', 26, 'Granada') ) def details_callback(data): return "<small><b>city:</b> <span foreground='#0000FF'>%s</span> \n" \ "<b>age:</b> %s</small>" % (data.city, data.age) win = gtk.Window() win.set_position(gtk.WIN_POS_CENTER) win.connect('destroy', gtk.main_quit) vbox = gtk.VBox() win.add(vbox) e = ComboEntry() e.set_details_callback(details_callback) for d in data: e.append_item(d.name, d) vbox.pack_start(e) win.show_all() gtk.main()
def testActivate(self): entry = ComboEntry() entry.connect('activate', self._on_activate) entry.entry.emit('activate') self.assertEqual(self.called, True)
def testSimple(self): entry = ComboEntry() self.assertTrue(isinstance(entry, ComboEntry))
def testSimple(self): entry = ComboEntry() self.failUnless(isinstance(entry, ComboEntry))