def create_window(self): """Create the main window.""" self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_resizable(False) self.window.set_title('Keyboard Status Monitor') width, height = 30 * self.options.scale, 48 * self.options.scale self.window.set_default_size(int(width), int(height)) self.window.set_decorated(self.options.decorated) self.mouse_indicator_win = shaped_window.ShapedWindow( self.svg_name('mouse-indicator'), self.options.click_opacity, color=self.options.click_color, timeout=self.options.visible_click_timeout) self.mouse_follower_win = shaped_window.ShapedWindow( self.svg_name('mouse-follower'), 0.5) if self.options.follow_mouse: self.mouse_follower_win.show() self.window.set_opacity(self.options.opacity) self.window.set_keep_above(True) self.event_box = gtk.EventBox() self.window.add(self.event_box) if self.options.bgcolor is not None: self.event_box.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(self.options.bgcolor)) self.event_box.show() self.create_images() self.hbox = gtk.HBox(False, 0) self.event_box.add(self.hbox) self.layout_boxes() self.hbox.show() self.add_events() self.set_accept_focus(False) self.window.set_skip_taskbar_hint(True) old_x = self.options.x_pos old_y = self.options.y_pos if old_x != -1 and old_y != -1 and old_x and old_y: self.window.move(old_x, old_y) self.window.show()
def create_window(self): """Create the main window.""" self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_resizable(False) self.window.set_title('Keyboard Status Monitor') width, height = 30 * self.options.scale, 48 * self.options.scale self.window.set_default_size(int(width), int(height)) self.window.set_decorated(self.options.decorated) self.mouse_indicator_win = shaped_window.ShapedWindow( self.svg_name('mouse-indicator')) #self.window.set_opacity(1.0) self.window.set_keep_above(True) self.event_box = gtk.EventBox() self.window.add(self.event_box) self.event_box.show() self.create_images() self.hbox = gtk.HBox(False, 0) self.event_box.add(self.hbox) self.layout_boxes() self.hbox.show() self.add_events() self.window.show() old_x = self.options.x_pos old_y = self.options.y_pos if old_x != -1 and old_y != -1 and old_x and old_y: self.window.move(old_x, old_y) self.update_shape_mask()