Added library - now I need to make things use it
This commit is contained in:
parent
21ea3bb7af
commit
dc64c2d1a9
|
|
@ -210,9 +210,8 @@ def new_file(widget=None):
|
||||||
root.onMouseMove = onMouseMoveGroup
|
root.onMouseMove = onMouseMoveGroup
|
||||||
MainWindow.stage.add(root,0,0)
|
MainWindow.stage.add(root,0,0)
|
||||||
def open_file(widget=None):
|
def open_file(widget=None):
|
||||||
|
|
||||||
MainWindow.stage.delete(root)
|
|
||||||
global root
|
global root
|
||||||
|
MainWindow.stage.delete(root)
|
||||||
thefile = svlgui.file_dialog("open").open("rb")
|
thefile = svlgui.file_dialog("open").open("rb")
|
||||||
root = pickle.load(thefile)
|
root = pickle.load(thefile)
|
||||||
MainWindow.stage.add(root, 0, 0)
|
MainWindow.stage.add(root, 0, 0)
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ CURRENTFRAME=0
|
||||||
#Object which has the keyboard focus.
|
#Object which has the keyboard focus.
|
||||||
FOCUS = None
|
FOCUS = None
|
||||||
|
|
||||||
|
#Library. Contatins all objects whether displayed or not.
|
||||||
|
Library = []
|
||||||
|
|
||||||
|
|
||||||
class Color (object):
|
class Color (object):
|
||||||
def __init__(self, val):
|
def __init__(self, val):
|
||||||
|
|
@ -756,6 +759,8 @@ class TextView(Widget):
|
||||||
|
|
||||||
class Image(object):
|
class Image(object):
|
||||||
def __init__(self,image,x=0,y=0,animated=False,canvas=None,htiles=1,vtiles=1):
|
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.x = x
|
||||||
self.y = y
|
self.y = y
|
||||||
self.minx = x
|
self.minx = x
|
||||||
|
|
@ -882,6 +887,8 @@ class Image(object):
|
||||||
class Shape (object):
|
class Shape (object):
|
||||||
def __init__(self,x=0,y=0,rotation=0,fillcolor=None,linecolor=None):
|
def __init__(self,x=0,y=0,rotation=0,fillcolor=None,linecolor=None):
|
||||||
global SITER
|
global SITER
|
||||||
|
global Library
|
||||||
|
Library.appemd(self)
|
||||||
self.x=x
|
self.x=x
|
||||||
self.y=y
|
self.y=y
|
||||||
self.rotation=rotation
|
self.rotation=rotation
|
||||||
|
|
@ -1477,6 +1484,8 @@ class Group (object):
|
||||||
level = property(getlevel, setlevel)
|
level = property(getlevel, setlevel)
|
||||||
scale = property(fset = setscale)
|
scale = property(fset = setscale)
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
global Library
|
||||||
|
Library.append(self)
|
||||||
self.layers = [Layer(*args)]
|
self.layers = [Layer(*args)]
|
||||||
self._al = 0
|
self._al = 0
|
||||||
self.clicked = False
|
self.clicked = False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue