Page 1 of 1

open program and toolbar

Posted: Mon Sep 14, 2009 5:57 pm
by TodayIsTheDay
Sorry, I'm just full of questions... the more I learn about RunRev, the more I want to learn.

How do I have a main program and a toolbar (like runtime) that both open and have the toolbar control things on the main screen?

I don't quite get how to tie all of this together...

Thanks!

Posted: Mon Sep 14, 2009 11:04 pm
by gyroscope
Hi TodayIsTheDay

One way of approaching it would be to make your main stack, being your main prog. Make a substack.

In the script of the main stack, put:

Code: Select all

on openStack
   -- palette stack "Untitled 2"
   open stack "Untitled 2"
end openStack
Save and Close and Remove from Memory. Open it again.

Now place your Tools (buttons) on the substack. Script each accordingly, for instance:

Code: Select all

on mouseDown
move image "A" on stack "Untitled 1" to 100,00
end mouseDown
etc.

When you've finished scripting, delete the "--" from the first script, save and close again, then reopen. The substack will be a pallete.

Hope that gives you a start...

PS There's a quicker way to toggle between pallete or not, using the Message Box; perhaps another Forum member will explain that, if you need it.

Posted: Tue Sep 15, 2009 3:24 am
by TodayIsTheDay
I must have gone about it all wrong. It seems it would make sense to open a stack, then add a substack to it.
I tried this and put code on the substack to do things on the main stack.

If I save and close the main stack, then re-open it the substack doesn't open... nor can I make buttons, etc control anything on the main stack.

I realize once I get this it will be easy to create programs, but I'm just having a little trouble. I'll play around with your example...

Thanks!

Posted: Tue Sep 15, 2009 12:04 pm
by gyroscope
Hi,
If I save and close the main stack, then re-open it the substack doesn't open...
That's a bit odd; providing you have the line: open stack "Untitled 2" (or whatever you've called it) in the script of the main stack, it should open...
nor can I make buttons, etc control anything on the main stack.
If a stack/substack is a palette, it's not possible to edit. It sounds like you've made the main stack the palette, and not the substack.

OK, a quick way to toggle between palette and an editable window is: open Message Box; type in: palette stack "Untitled 2"; press return.....this is how it'll be in your finished app, used here for testing. To change back for editing, type in: set the style of stack "Untitled 2" to topLevel and press return in the Message Box.

Only when you've finished and are ready to make the standalone, (or finished the stack, if it's staying as that) do you remove "--" from the main stack script.

:)