import gtk from quickly.widgets.dictionary_grid import DictionaryGrid
win = gtk.Window() win.set_title("This is a bug") vbox = gtk.VBox() hbox = gtk.HBox() add_button = gtk.Button("Add row") print_button = gtk.Button("Print dictionaries") hbox.pack_start(add_button, True, True) hbox.pack_start(print_button, True, True)
keys = ["first_name", "last_name"] dg = DictionaryGrid(keys=keys) dg.editable = True vbox.pack_start(dg, True, True) vbox.pack_start(hbox, False, False) win.add(vbox) win.show_all()
def print_dicts(widget): print(dg.get_dictionaries_copy())
def add_row(widget): dg.append_row({})
print_button.connect("clicked", print_dicts) add_button.connect("clicked", add_row) win.connect("delete-event", gtk.main_quit) gtk.main()
Add some rows and print it out. You'll see that it returns just an empty list.
import gtk widgets. dictionary_ grid import DictionaryGrid
from quickly.
win = gtk.Window() start(add_ button, True, True) start(print_ button, True, True)
win.set_title("This is a bug")
vbox = gtk.VBox()
hbox = gtk.HBox()
add_button = gtk.Button("Add row")
print_button = gtk.Button("Print dictionaries")
hbox.pack_
hbox.pack_
keys = ["first_name", "last_name"] keys=keys) start(hbox, False, False)
dg = DictionaryGrid(
dg.editable = True
vbox.pack_start(dg, True, True)
vbox.pack_
win.add(vbox)
win.show_all()
def print_dicts( widget) : dg.get_ dictionaries_ copy())
print(
def add_row(widget): append_ row({})
dg.
print_button. connect( "clicked" , print_dicts) connect( "clicked" , add_row) "delete- event", gtk.main_quit)
add_button.
win.connect(
gtk.main()
Add some rows and print it out. You'll see that it returns just an empty list.