def __init__(self, parent): PalabraDialog.__init__(self, parent, u"Manage clue databases") self.pwindow = parent self.store, self.tree, window = create_tree((str, str) , [(u"Name", 0), (u"Path", 1)] , f_sel=self.on_file_selected , window_size=(300, 300)) self.pack(window) buttonbox = gtk.HButtonBox() buttonbox.set_layout(gtk.BUTTONBOX_START) self.add_file_button = create_stock_button(gtk.STOCK_ADD , f_click=lambda b: self.on_add_clue_db()) buttonbox.pack_start(self.add_file_button, False, False) self.props_button = create_stock_button(gtk.STOCK_PROPERTIES, f_click=lambda b: self.on_properties()) buttonbox.pack_start(self.props_button, False, False) self.props_button.set_sensitive(False) self.remove_button = create_stock_button(gtk.STOCK_REMOVE , f_click=lambda b: self.on_remove_db()) buttonbox.pack_start(self.remove_button, False, False) self.remove_button.set_sensitive(False) self.pack(buttonbox) label = create_label(u"These clue databases are loaded when you start " + constants.TITLE + ".") self.pack(label, False) self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) self.load_clue_files(parent.clues)
def __init__(self, parent): PalabraDialog.__init__(self, parent, u"Edit word lists", horizontal=True) self.wordlists = parent.wordlists # name path self.store, self.tree, s_window = create_tree((str, str) , [("Available word lists", 0)] , f_sel=self.on_tree_selection_changed , window_size=(256, 196)) for wlist in self.wordlists: self.store.append([wlist.name, wlist.path]) self.main.pack_start(s_window, True, True, 0) self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
def __init__(self, palabra_window, properties): PalabraDialog.__init__(self, palabra_window, u"Appearance") self.palabra_window = palabra_window hbox = gtk.HBox() hbox.set_spacing(18) hbox.pack_start(self.create_content(properties)) mode = constants.VIEW_MODE_PREVIEW_SOLUTION self.preview = GridPreview(mode=mode, cell_size=None) self.preview.set_size_request(200, 200) hbox.pack_start(self.preview, False, False, 0) self.pack(hbox) g = Grid(3, 3) g.set_block(0, 2, True) g.set_void(2, 0, True) g.set_char(0, 0, "A") g.assign_numbers() self.preview.display(g) self.on_update() self.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) self.add_button(gtk.STOCK_APPLY, gtk.RESPONSE_OK)