Add testcase for Gtk.ComboBox
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
This commit is contained in:
parent
a7e0e5ae57
commit
b9234202ab
24
tests/graphics/combobox.py
Normal file
24
tests/graphics/combobox.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
import common
|
||||||
|
|
||||||
|
|
||||||
|
test = common.Test()
|
||||||
|
test.show()
|
||||||
|
|
||||||
|
# test Gtk.ComboBox:
|
||||||
|
|
||||||
|
store = Gtk.ListStore(int, str)
|
||||||
|
for i in range(100):
|
||||||
|
description = "combo test entry %d" % i
|
||||||
|
store.append([i, description])
|
||||||
|
|
||||||
|
combobox = Gtk.ComboBox(model=store)
|
||||||
|
cell = Gtk.CellRendererText()
|
||||||
|
combobox.pack_start(cell, True)
|
||||||
|
combobox.add_attribute(cell, 'text', 1)
|
||||||
|
test.pack_start(combobox, True, True, 0)
|
||||||
|
combobox.show()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
common.main(test)
|
Loading…
Reference in New Issue
Block a user