self.draw = self.wid('draw')
self.draw.connect('expose-event', self.expose_draw)
- # FIXME: Hardcoded.
- self.image = 'skol.jpg'
- self.balls = self.load_balls_from_file('xxx')
- self.load_balls_to_treeview()
+ # Starting with an empty project with no image loaded
+ self.project = None
+ self.image = None
+
+ # This attr may be overriten, if so, call the method (load_balls_to_treeview)
+ self.balls = BallManager()
- # this *MUST* be called *AFTER* load_balls_to_treeview
+ self.load_balls_to_treeview()
self.setup_treeview()
+ # drawing stuff
self.ball_width = Ball.DEFAULT_WIDTH
self.selecting = False
self.start_x = -1
self.load_new_project(proj.get_project())
proj.destroy()
- def open_file_chooser(self, button):
+ def open_project(self, *args):
fc = gtk.FileChooserDialog(_('Choose a gzv project'), self.window,
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OK, gtk.RESPONSE_OK))
if fc.run() == gtk.RESPONSE_OK:
- self.image = fc.get_filename()
+ proj_file = fc.get_filename()
+ self.balls = self.load_balls_from_file(proj_file)
fc.destroy()