Stack Buttons

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 246
Joined: Tue Jun 30, 2009 11:15 pm

Stack Buttons

Post by SirWobbyTheFirst » Fri Oct 02, 2009 10:21 pm

I am wanting to create a stack which shows each open stack as a button much like the Windows taskbar and i was wondering how i could script the stack to do this.

Any help would be much appreciated.

PS. I am thinking of creating this as a plugin for Revolution so that users can easily switch stacks especially if the stack doesn't have a window.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Sat Oct 03, 2009 12:45 pm

Your best start is the openStacks property. Here's something to get you started - assuming you have a button and a single image control named "MySnapshot"':

Code: Select all

on mouseUp
  put the openStacks into tOpenStacks
  filter tOpenStacks without "rev*"  -- skip IDE stacks
  repeat for each line tOpenStack in tOpenStacks
    if tOpenStack is the short name of this stack then next repeat
    if the visible of stack tOpenStack then
      export snapshot from the current card of stack tOpenStack to image "MySnapshot" as PNG
    end if
    wait 1 second
  end repeat
end mouseUp
HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Post Reply