def create_set_res_window(self):
self.set_res_window = Gtk.Window(
title = _("Konung 2: Blood of Titans"),
type = Gtk.WindowType.TOPLEVEL,
window_position = Gtk.WindowPosition.CENTER_ALWAYS,
resizable = False,
default_width = 360
)
self.set_res_window.connect('delete-event', self.quit_app)
grid = Gtk.Grid(
margin_left = 10,
margin_right = 10,
margin_top = 10,
margin_bottom = 10,
row_spacing = 10,
column_spacing = 10,
column_homogeneous = True,
)
label_custom_res = Gtk.Label(
label = _("Custom resolution:")
)
self.combobox_resolution = Gtk.ComboBoxText()
resolutions_list = sorted(os.listdir(game_dir + '/res_patch'))
for resolution in resolutions_list:
self.combobox_resolution.append_text(resolution)
self.combobox_resolution.set_active(self.resolution)
self.combobox_resolution.connect('changed', self.cb_combobox_resolution)
button_save = Gtk.Button(
label = _("Save and quit"),
)
button_save.connect('clicked', self.cb_button_save)
grid.attach(label_custom_res, 0, 0, 1, 1)
grid.attach(self.combobox_resolution, 1, 0, 1, 1)
grid.attach(button_save, 0, 2, 2, 1)
self.set_res_window.add(grid)
settings.py 文件源码
python
阅读 42
收藏 0
点赞 0
评论 0
评论列表
文章目录