Exemplo n.º 1
0
 def testPopup(self):
     entry = ComboEntry()
     win = Gtk.Window()
     win.add(entry)
     win.show_all()
     entry.hide()
     entry.popup()
     entry.popdown()
Exemplo n.º 2
0
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()
Exemplo n.º 3
0
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()
Exemplo n.º 4
0
 def testActivate(self):
     entry = ComboEntry()
     entry.connect('activate', self._on_activate)
     entry.entry.emit('activate')
     self.assertEqual(self.called, True)
Exemplo n.º 5
0
 def testSimple(self):
     entry = ComboEntry()
     self.assertTrue(isinstance(entry, ComboEntry))
Exemplo n.º 6
0
 def testSimple(self):
     entry = ComboEntry()
     self.failUnless(isinstance(entry, ComboEntry))