def preferences(self, action):
self.builder = Gtk.Builder()
self.builder.set_translation_domain(gv.domain)
self.builder.add_from_file(self.glade_file_preferences)
self.builder.connect_signals(self)
dialog = self.builder.get_object("preferences")
dialog.set_transient_for(self.window)
# show co-ords
coords_checkbutton = self.builder.get_object("coords_checkbutton")
coords_checkbutton.set_active(self.show_coords)
# highlight moves
highlight_moves_checkbutton = self.builder.get_object(
"highlight_checkbutton")
highlight_moves_checkbutton.set_active(self.highlight_moves)
response = dialog.run()
resp_cancel = 1
resp_ok = 2
if response == resp_ok:
self.show_coords = coords_checkbutton.get_active()
self.highlight_moves = highlight_moves_checkbutton.get_active()
# rect = self.border_eb.get_allocation()
# gv.board.update()
self.border_eb.queue_draw()
dialog.destroy()
评论列表
文章目录