stack inside stack

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

pmc
Posts: 62
Joined: Thu Sep 23, 2010 3:14 am

stack inside stack

Post by pmc » Thu Sep 23, 2010 4:56 am

Hi everybody. I am new to Rev and programming. Never did any programming before.
I would like to create a stack within a stack, meaning that the Main Stack will hold all the substacks. Right now, all my substack are individual stacks outside the Main Stack. Can anyone help? Thanks.

deebee
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 89
Joined: Mon Jul 19, 2010 6:59 am
Location: Illinois, USA

Re: stack inside stack

Post by deebee » Thu Sep 23, 2010 6:17 am

Hi pmc, I'm brand new to this too. But if you want things in the same "window," then you want to make new cards instead of stacks. That's my best guess at least.

pmc
Posts: 62
Joined: Thu Sep 23, 2010 3:14 am

Re: stack inside stack

Post by pmc » Thu Sep 23, 2010 6:29 am

Hi Deebee

Thanks for replying. No, it does not work that way either. I did that and those cards are copies of the mainstack. They behave the same. When you delete the substack's menu bar, the mainstack's menu bar is deleted as well. I want something like the Microsoft's words or something similar, with the main window holding everything else. Like the MS's word, you create documents within the main window. Can't this be done in Rev? Thanks

pmc
Posts: 62
Joined: Thu Sep 23, 2010 3:14 am

Re: stack inside stack

Post by pmc » Thu Sep 23, 2010 6:41 am

I put in this script:

case "New"
--Insert script for New menu item here
Create card "New"
break

But it is creating new cards.

Klaus
Posts: 12124
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: stack inside stack

Post by Klaus » Thu Sep 23, 2010 9:48 am

Hi pmc,

you can use the message box with a script of use the inspector for your stacks!

Do this with the inspector:
1. Open the stack that will be the MAINSTACK
2. Open all the stacks (or one after another) that are going to be the SUBSTACKS
3. Open the "Inspector" (Property inspector) for all these substacks and in the popup button "Mainstack"
(directly under "Name" and "Title") select the name of your MAINSTACK
4. Save all the stacks that are now substacks of your mainstack
5. Be happy :D

You can also do this via script (like in the message box):
set the mainstack of stack "you substack here" to "Name of mainstack here"


Best from germany

Klaus

pmc
Posts: 62
Joined: Thu Sep 23, 2010 3:14 am

Re: stack inside stack

Post by pmc » Thu Sep 23, 2010 4:43 pm

Hi Klaus

Thanks for reply. But that is not what I need. I want my substack to be inside the panel of the Mainstack, which does not go beyond it(the mainstack). Something like an object, eg. Tab panel, which you put into a card. You see, the tab panel which you put in a card does not 'move' out from this card, it stayed inside it. And furthermore, you are able to specify the size and position of the tab panel in the card. This is what I meant. Surely there must be an easy way. I've been trying to do this for few days and I can't find any example of people doing this. Thanks for helping.

Klaus
Posts: 12124
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: stack inside stack

Post by Klaus » Thu Sep 23, 2010 4:52 pm

Ah, oh, I see!

I think this is not possible, since every stack is a sepearate window(sic!) of its own!
But maybe I still don't get what you are after 8)

Best

Klaus

pmc
Posts: 62
Joined: Thu Sep 23, 2010 3:14 am

Re: stack inside stack

Post by pmc » Thu Sep 23, 2010 5:02 pm

sorry, can't seems to attached at this post
Last edited by pmc on Thu Sep 23, 2010 5:13 pm, edited 1 time in total.

pmc
Posts: 62
Joined: Thu Sep 23, 2010 3:14 am

Re: stack inside stack

Post by pmc » Thu Sep 23, 2010 5:12 pm

Hi Klaus

You mean it is not possible to do that?? Please look at the attached images. I want the substack to stay within the mainstack (image 'capture 1'). Right now the substack seems to be another card on its own (capture 2). How can I do that?
Attachments
Capture2.GIF
capture 2
Capture2.GIF (17.27 KiB) Viewed 3615 times
Capture 1.GIF
capture 1
Capture 1.GIF (22.38 KiB) Viewed 3615 times

Klaus
Posts: 12124
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: stack inside stack

Post by Klaus » Thu Sep 23, 2010 5:30 pm

Ah, now I think I get it :D
Waht you mean is the so called MDI (Multiple document interface) like Photoshop on Windows uses.
Which means everything is in the "bounds" of the "master" window, right?

Unfortunately this is not possible without many tricks and fakes in LiveCode!
LiveCode uses SDI (Singel document interface).

You could script the "movestack" message of all your substacks to stay in the dimensions
of your mainstack, but this is not " the real McCoy", since cliking on the mainstack would
bring its window to front, unless all your substacks are palette windows.

Best

Klaus

pmc
Posts: 62
Joined: Thu Sep 23, 2010 3:14 am

Re: stack inside stack

Post by pmc » Thu Sep 23, 2010 5:36 pm

Can I create 'pallete cards' to do the trick?

Klaus
Posts: 12124
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: stack inside stack

Post by Klaus » Thu Sep 23, 2010 5:51 pm

A stack can be opened as a palette, so card will appear as palettes, too.
I wish you good luck with your MDI fake :)

pmc
Posts: 62
Joined: Thu Sep 23, 2010 3:14 am

Re: stack inside stack

Post by pmc » Fri Sep 24, 2010 2:23 am

Hi Klaus

Thanks you very much. Maybe I'll rethink my plan.

openworld
Posts: 63
Joined: Sat Sep 11, 2010 3:56 am
Location: Virginia, USA
Contact:

Re: stack inside stack

Post by openworld » Thu Oct 28, 2010 4:54 am

Klaus,

I'm also new to LiveCode - I created and saved a substack called "Quicktagger", but am finding no way to make it visible! Is there a script handler or message box command that will make it visible, ideally as a palette popup?

Look forward to any way to move forward --

Best,

Mark Frazier
@openworld
Klaus wrote:A stack can be opened as a palette, so card will appear as palettes, too.
I wish you good luck with your MDI fake :)

Klaus
Posts: 12124
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: stack inside stack

Post by Klaus » Thu Oct 28, 2010 10:22 am

Hi Mark,

maybe:
...
palette "Quicktagger"
...
will work for you?

Or dou you mean the stack is really not "visible" which IS indeed a porperty of a stack? :D


Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”