def __init__(self): ApplicationWindow.__init__(self, 'widget', self.WIDTH, self.HEIGHT_COMPACT) self.wprompts = WidgetPrompts() self.wprompts.load_prompts() self._initialise_window() if not self.wprompts.get_current_prompt(): self.hide_until_more_questions() return self.position_widget() # Catch the window state event to avoid minimising and losing # the window self.connect("window-state-event", self._unminimise_if_minimised)
def __init__(self): ApplicationWindow.__init__(self, 'Kano Video', 920, 0) self.set_icon_from_file(os.path.join(icon_dir, 'video.png')) self.grid = Gtk.Grid() self.set_main_widget(self.grid) menu_bar = MenuBar() self.grid.attach(menu_bar, 0, 0, 1, 1) self.contents = Contents(self.grid) self.contents.set_size_request(self._win_width, 570) self.switch_view('home') self.grid.attach(self.contents, 0, 1, 1, 1) self.connect('delete-event', self.on_close) self.connect('show', self.on_show)
def __init__(self, install=None, icon_only=False, tutorial=False): ApplicationWindow.__init__(self, 'Apps', 755, 588) self._install = install self._tutorial = tutorial self._icon_only = icon_only self._last_page = 0 self.connect("show", self._app_loaded) # Destructor self.connect('delete-event', Gtk.main_quit) self.set_icon_from_file("/usr/share/kano-desktop/icons/apps.png") # Styling screen = Gdk.Screen.get_default() specific_css_provider = Gtk.CssProvider() specific_css_provider.load_from_path(Media.media_dir() + 'css/style.css') specific_style_context = Gtk.StyleContext() specific_style_context.add_provider_for_screen( screen, specific_css_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER ) style = self.get_style_context() style.add_class('main_window') # Setup widgets self.set_decorated(True) self._top_bar = TopBar(_("Apps"), self._win_width, False) self._top_bar.set_close_callback(Gtk.main_quit) self.set_titlebar(self._top_bar) self._contents = Contents(self) self.set_main_widget(self._contents) self.show_apps_view()
def __init__(self): apply_common_to_screen() self.a = self.b = self.c = 0 self.switching = 0 ApplicationWindow.__init__(self, _('Login'), self.WIDTH, self.HEIGHT) self.connect("delete-event", Gtk.main_quit) # Create a new LightDM.Greeter instance which will be used by the 2 views self.greeter = GreeterWindow.greeter.new() # Create the two views: one for normal Login, the other to create a new account self.password_view = PasswordView(None, self.greeter) self.newuser_view = NewUserView(self.greeter) self.login_with_kw_view = LoginWithKanoWorldView(self.greeter) self.grid = Gtk.Grid() self.set_main_widget(self.grid) self.grid.set_column_spacing(30) self.grid.set_row_spacing(30) self.top_bar = TopBar(_('Login')) self._remove_top_bar_buttons() self.top_bar.set_size_request(self.WIDTH, -1) self.grid.attach(self.top_bar, 0, 0, 3, 1) self.grid.attach(Gtk.Label(), 0, 3, 3, 1) self.top_bar.set_prev_callback(self._back_cb) self.user_list = UserListView() self.go_to_users() cursor = Gdk.Cursor.new(Gdk.CursorType.ARROW) self.get_root_window().set_cursor(cursor)
def __init__(self, install=None, icon_only=False, tutorial=False): ApplicationWindow.__init__(self, 'Apps', 755, 588) self._install = install self._tutorial = tutorial self._icon_only = icon_only self._last_page = 0 self.connect("show", self._app_loaded) # Destructor self.connect('delete-event', Gtk.main_quit) self.set_icon_from_file("/usr/share/kano-desktop/icons/apps.png") # Styling screen = Gdk.Screen.get_default() specific_css_provider = Gtk.CssProvider() specific_css_provider.load_from_path(Media.media_dir() + 'css/style.css') specific_style_context = Gtk.StyleContext() specific_style_context.add_provider_for_screen( screen, specific_css_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER) style = self.get_style_context() style.add_class('main_window') # Setup widgets self.set_decorated(True) self._top_bar = TopBar(_("Apps"), self._win_width, False) self._top_bar.set_close_callback(Gtk.main_quit) self.set_titlebar(self._top_bar) self._contents = Contents(self) self.set_main_widget(self._contents) self.show_apps_view()
self, win, header=_("Pick your background"), subheader=_("New wallpapers unlocked! Level up to get more."), buttons_shown=2) self.win.set_main_widget(self) self.sw.set_margin_bottom(20) self.sw.set_margin_top(25) self.sw.set_margin_left(25) self.sw.set_margin_right(25) self.win.set_size_request(680, 600) self.win.show_all() def apply_changes(self, button, event): SetWallpaper.apply_changes(self, button, event) Gtk.main_quit() if __name__ == "__main__": from kano.gtk3.application_window import ApplicationWindow win = ApplicationWindow("blah", 10, 10) wallpaper = FirstBootSetWallpaper(win) win.connect('delete-event', Gtk.main_quit) win.show_all() Gtk.main()
def __init__(self, win): SetWallpaper.__init__(self, win, header='Yes! You built your desktop.', subheader='New backgrounds unlocked! Level up to get more.', buttons_shown=2) self.win.set_main_widget(self) self.sw.set_margin_bottom(20) self.sw.set_margin_top(25) self.sw.set_margin_left(25) self.sw.set_margin_right(25) self.win.set_size_request(680, 600) self.win.show_all() def apply_changes(self, button, event): SetWallpaper.apply_changes(self, button, event) Gtk.main_quit() if __name__ == "__main__": from kano.gtk3.application_window import ApplicationWindow win = ApplicationWindow("blah", 10, 10) wallpaper = FirstBootSetWallpaper(win) win.connect('delete-event', Gtk.main_quit) win.show_all() Gtk.main()