Execute now actually executes
This commit is contained in:
parent
97e0a65a73
commit
9e6f7f8dec
|
|
@ -12,6 +12,9 @@ import lightningbeam_windows
|
|||
#pickle - used to save and open files
|
||||
import pickle
|
||||
|
||||
#misc_funcs - miscelleneous functions in a separate file so as not to clutter things up too much
|
||||
import misc_funcs
|
||||
|
||||
#specify the current version and what version files it can still open
|
||||
LIGHTNINGBEAM_VERSION = "1.0-alpha1"
|
||||
LIGHTNINGBEAM_COMPAT = ["1.0-alpha1"]
|
||||
|
|
@ -138,6 +141,36 @@ def run_file(self=None):
|
|||
root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions = MainWindow.scriptwindow.text
|
||||
open("test.sc", "w").write(create_sc(root))
|
||||
svlgui.execute("swfc/swfc_"+svlgui.PLATFORM+" test.sc -o test.swf")
|
||||
logloc = "/Users/skyler/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt"
|
||||
try:
|
||||
logfile.close()
|
||||
except:
|
||||
pass
|
||||
logfile = open(logloc,"w")
|
||||
logfile.write("")
|
||||
logfile.close()
|
||||
outputwin = svlgui.Window("Output")
|
||||
outputwin.resize(200,500)
|
||||
outputtext = svlgui.TextView(False)
|
||||
outputwin.add(outputtext)
|
||||
logfile = open(logloc, "r")
|
||||
def updatetrace(outputtext):
|
||||
try:
|
||||
outputtext.text+=logfile.readline()
|
||||
outputtext.scroll_bottom() # this doesn't work
|
||||
except:
|
||||
pass
|
||||
r = misc_funcs.RepeatTimer(0.02, updatetrace, args=[outputtext])
|
||||
print dir(outputwin.window)
|
||||
r.daemon = True
|
||||
r.start()
|
||||
if svlgui.PLATFORM=="osx":
|
||||
osx_flash_player_loc = "/Applications/Flash\ Player\ Debugger.app"
|
||||
svlgui.execute("open -a "+osx_flash_player_loc+" test.swf")
|
||||
elif svlgui.PLATFORM=='win32':
|
||||
svlgui.execute('start '+win_flash_player_loc+" test.swf")
|
||||
elif svlgui.PLATFORM.startswith('linux'):
|
||||
svlgui.execute('xdg-open '+linux_flash_player_loc+" test.swf")
|
||||
|
||||
|
||||
def box(x, y, width, height, fill=None):
|
||||
|
|
@ -336,7 +369,7 @@ svlgui.menufuncs([["File",
|
|||
"Export .pdf",
|
||||
"Export Animated GIF"],
|
||||
["Tools",
|
||||
("Execute",run_file,"<Alt>Return")],
|
||||
("Execute",run_file,"/\r")],
|
||||
["Modify",
|
||||
"Document",
|
||||
"Convert to Symbol",
|
||||
|
|
|
|||
14
svlgui.py
14
svlgui.py
|
|
@ -283,6 +283,8 @@ class Window:
|
|||
self.window.connect("destroy",self.destroy)
|
||||
elif SYSTEM=="osx":
|
||||
self.window = LightningbeamWindow(width=1024,height=500)
|
||||
if not title=="":
|
||||
self.window.title = title
|
||||
#components = [i._int() for i in args]
|
||||
#self.vbox = GUI.Column(components, equalize="w", expand=0)
|
||||
#self.window.place(self.vbox, left = 0, top = 0, right = 0, bottom = 0, sticky = 'nsew')
|
||||
|
|
@ -318,6 +320,9 @@ class Window:
|
|||
self.window.title = title
|
||||
elif SYSTEM=="html":
|
||||
jscommunicate("document.title = "+title)
|
||||
def resize(self,x,y):
|
||||
if SYSTEM=="osx":
|
||||
self.window.resize(width=x,height=y)
|
||||
|
||||
# Widget meta-class - to prevent code duplication
|
||||
# I don't seem to have any code in here. :(
|
||||
|
|
@ -398,7 +403,7 @@ def menufuncs(j):
|
|||
if n[1].__name__=="run_file":
|
||||
app.run_file = test'''
|
||||
[setattr(app,k[1].__name__, k[1]) for k in i if type(k)==type(())]
|
||||
menu = GUI.Menu(i[0],[(k[0],k[1].__name__) for k in i if type(k)==type(())])
|
||||
menu = GUI.Menu(i[0],[((k[0]+k[2],k[1].__name__) if (len(k)==3 and "/" in k[2]) else (k[0],k[1].__name__)) for k in i if type(k)==type(())])
|
||||
#menu = GUI.Menu("Test", [("Run", 'run_file')])
|
||||
menus.append(menu)
|
||||
else:
|
||||
|
|
@ -747,6 +752,8 @@ class TextView(Widget):
|
|||
self.become_target()
|
||||
self.box = OSXTextEditor(scrolling="hv")
|
||||
self.box.font = Font("Mono", 12, [])
|
||||
if width and height:
|
||||
self.box.size = (width, height)
|
||||
elif SYSTEM=="html":
|
||||
self.box = htmlobj("textarea")
|
||||
def _int(self):
|
||||
|
|
@ -756,6 +763,9 @@ class TextView(Widget):
|
|||
return self.box
|
||||
elif SYSTEM=="html":
|
||||
return self.box
|
||||
def scroll_bottom(self):
|
||||
if SYSTEM=="osx":
|
||||
self.scroll_page_down();
|
||||
|
||||
class Image(object):
|
||||
def __init__(self,image,x=0,y=0,animated=False,canvas=None,htiles=1,vtiles=1):
|
||||
|
|
@ -888,7 +898,7 @@ class Shape (object):
|
|||
def __init__(self,x=0,y=0,rotation=0,fillcolor=None,linecolor=None):
|
||||
global SITER
|
||||
global Library
|
||||
Library.appemd(self)
|
||||
Library.append(self)
|
||||
self.x=x
|
||||
self.y=y
|
||||
self.rotation=rotation
|
||||
|
|
|
|||
Loading…
Reference in New Issue