def create_main_window(self):
self.main_window = Gtk.Window(
title = _("Eador: Genesis"),
type = Gtk.WindowType.TOPLEVEL,
window_position = Gtk.WindowPosition.CENTER_ALWAYS,
resizable = False,
default_width = 360,
default_height = 180
)
self.main_window.connect('delete-event', self.quit_app)
label = Gtk.Label(
halign = Gtk.Align.FILL,
label = _("Mode:"),
)
radiobutton_windowed = Gtk.RadioButton(
label = _("Windowed"),
name = 'windowed'
)
radiobutton_windowed.connect('toggled', self.cb_radiobuttons)
radiobutton_fullscreen = Gtk.RadioButton(
label = _("Fullscreen"),
name = 'fullscreen'
)
radiobutton_fullscreen.join_group(radiobutton_windowed)
radiobutton_fullscreen.connect('toggled', self.cb_radiobuttons)
if not self.fullscreen:
radiobutton_windowed.set_active(True)
else:
radiobutton_fullscreen.set_active(True)
button_save = Gtk.Button(
label = _("Save and quit"),
)
button_save.connect('clicked', self.cb_button_save)
box = Gtk.Box(
margin_top = 10,
margin_bottom = 10,
margin_left = 10,
margin_right = 10,
spacing = 10,
orientation = Gtk.Orientation.VERTICAL
)
box.pack_start(label, True, True, 0)
box.pack_start(radiobutton_windowed, True, True, 0)
box.pack_start(radiobutton_fullscreen, True, True, 0)
box.pack_start(button_save, True, True, 0)
self.main_window.add(box)
self.main_window.show_all()
settings.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录