Maybe this is a noob question...
Posted: Wed Apr 01, 2015 3:00 am
But, how do I set the location on the screen of a stack? The code below creates the stack, and if I examine the size and position properties I can see that the Location property gets set to 0,0. But the stack stays where it was created on screen. Do i need to call some form of refresh? This is on OSX.
Code: Select all
on dragStart
set the dragData["files"] to empty
set the dragImage to the id of me
set the allowableDragActions to "copy"
set the dragAction to "copy"
pass dragStart
end dragStart
on dragEnd
CreateNewDBStack("New Databse Stack", "Default.sdb")
end dragEnd
command CreateNewDBStack pNewStackName, pDBname
#create stack
create stack pNewStackName
put it into tTheNewStack
#put the screenMouseLoc into gMousePos
put 0,0 into gMousePos
set the loc of tTheNewStack to gMousePos
#set the loc of tTheNewStack to the screenLoc
set the DBPath of tTheNewStack to pDBName
#create DBscript on stack
#local tScript
#put "global gDBConnectionID"&cr into tScript
#put "command onPreOpenStack"&cr after tScript
#put " library stack ""e&"DatabaseLibrary.livecode""e&cr after tScript
#put " put the DBPath of me into tDBPath"&cr after tScript
#put " put databaseConnect(tDBPath) into gDBConnectionID" &cr after tScript
#put "end onPreOpenStack" after tScript
#set the script of tTheNewStack to tScript
end CreateNewDBStack