diff --git a/Window.py b/Window.py index cde4b2a..ec40a79 100755 --- a/Window.py +++ b/Window.py @@ -17,16 +17,28 @@ class Window(object): self.window.connect('button-release-event', self.button_release) self.window.set_events(gtk.gdk.BUTTON_RELEASE_MASK) + if 'x' in self.conf and 'y' in self.conf: + self.window.move(self.conf['x'], self.conf['y']) + self.window.show_all() def run(self): gtk.main() + def update_conf(self): + w, h = self.window.get_size() + self.conf['width'] = w + self.conf['height'] = h + x, y = self.window.get_position() + self.conf['x'] = x + self.conf['y'] = y + def destroy_event(self): + self.update_conf() gtk.main_quit() return False def button_release(self, widget, event): if event.button == 3: - gtk.main_quit() + self.destroy_event() return True