def get_desktop_page(self, desktop): _grid = Gtk.Grid() _image = Gtk.Image() _text = Gtk.TextView() _buffer = Gtk.TextBuffer() _return_button = Gtk.Button(_("Return")) _install_button = Gtk.Button(_("Install")) _file = open(common.TEXT_PATH + desktop, 'r') _image.set_from_file(common.IMAGE_PATH + desktop + '.png') _image.set_alignment(0.5, 0.5) _buffer.set_text(_file.read()) _text.set_buffer(_buffer) _text.set_wrap_mode(Gtk.WrapMode.WORD) _return_button.connect("clicked", self.on_return_button_clicked, None) _grid.set_column_homogeneous(True) _grid.attach(_image, 0, 0, 2, 1) _grid.attach(_text, 0, 1, 2, 1) _grid.attach(_return_button, 0, 2, 1, 1) _grid.attach(_install_button, 1, 2, 1, 1) _scroll = common.init_scroll(_grid) _file.close() return _scroll
def intro(self): _desktop_box = common.init_flowbox() _unity_button = \ common.set_button_image(common.IMAGE_PATH + "unity_top.png") _gnome3_button = \ common.set_button_image(common.IMAGE_PATH + "gnome3_top.png") _kde5_button = \ common.set_button_image(common.IMAGE_PATH + "kde5_top.png") _unity_button.connect("clicked", self.on_desktop_button_clicked, "unity") _gnome3_button.connect("clicked", self.on_desktop_button_clicked, "gnome3") _kde5_button.connect("clicked", self.on_desktop_button_clicked, "kde5") _desktop_box.insert(_unity_button, 0) _desktop_box.insert(_gnome3_button, 1) _desktop_box.insert(_kde5_button, 2) _desktop_scrolled = common.init_scroll(_desktop_box) return _desktop_scrolled