Code To Unmaximize A LiveCode Stack (window) On A Linux System

Sorry this code is only for Linux. I haven't worked in Windows in quite a while.

Back To LiveCode Main Page

Since I haven't found any means to unmaximize a stack dynamically within LiveCode I turned to using the Linux line command wmctrl to do the deed. First I put the wmctrl command with the necessary parameters into a variable named cmd and then used the shell command to call it. It is that simple. After the stack has been "unmaximized" you can use standard LiveCode commands to resize, move it etc. To learn more about the wmctrl command you can visit its Linux Man Page here.

on mouseUp pMouseButton
# Insert Linux line command wmctrl with necessary parameters into variable named cmd
put "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz" into cmd
get shell (cmd) # use shell command to call the line command to unmaximize the active window…
#… which is this stack.
end mouseUp


If you are wondering if you have the a command like wmctrl on your Linux system you can alway just open a terminal (You can try pressing CTRL+ALT+T) and enter in the following command which with whatever command you wish to check on. The which command reveals the location of commands, apps or software on the system. If nothing is revealed then the command/software is not installed or it isn't in the path or you entered the name wrong.

As you can see below, after I entered in
which wmctrl the location given is /usr/bin.

Maybe someday I will dust off the old Windoze machine and try my hand at figuring out how to repeat this trick there. Been a few years since I ran Windows in my house.


~



Tested with LiveCode 9.0 in Linux Mint 18 (Sarah)