From dc64c2d1a9871aaa5c2c4fa9f12c5cad99d87848 Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Tue, 10 Jan 2012 23:04:42 -0500 Subject: [PATCH] Added library - now I need to make things use it --- lightningbeam | 3 +-- svlgui.py | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lightningbeam b/lightningbeam index 491cdcc..c6da7c4 100755 --- a/lightningbeam +++ b/lightningbeam @@ -210,9 +210,8 @@ def new_file(widget=None): root.onMouseMove = onMouseMoveGroup MainWindow.stage.add(root,0,0) def open_file(widget=None): - - MainWindow.stage.delete(root) global root + MainWindow.stage.delete(root) thefile = svlgui.file_dialog("open").open("rb") root = pickle.load(thefile) MainWindow.stage.add(root, 0, 0) diff --git a/svlgui.py b/svlgui.py index 0cd0296..405b9cd 100644 --- a/svlgui.py +++ b/svlgui.py @@ -33,6 +33,9 @@ CURRENTFRAME=0 #Object which has the keyboard focus. FOCUS = None +#Library. Contatins all objects whether displayed or not. +Library = [] + class Color (object): def __init__(self, val): @@ -756,6 +759,8 @@ class TextView(Widget): class Image(object): def __init__(self,image,x=0,y=0,animated=False,canvas=None,htiles=1,vtiles=1): + global Library + Library.append(self) self.x = x self.y = y self.minx = x @@ -882,6 +887,8 @@ class Image(object): class Shape (object): def __init__(self,x=0,y=0,rotation=0,fillcolor=None,linecolor=None): global SITER + global Library + Library.appemd(self) self.x=x self.y=y self.rotation=rotation @@ -1477,6 +1484,8 @@ class Group (object): level = property(getlevel, setlevel) scale = property(fset = setscale) def __init__(self, *args, **kwargs): + global Library + Library.append(self) self.layers = [Layer(*args)] self._al = 0 self.clicked = False