Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
richmond62
- Livecode Opensource Backer

- Posts: 10094
- Joined: Fri Feb 19, 2010 10:17 am
Post
by richmond62 » Thu Apr 25, 2024 4:41 pm
I should like a main stack to appear as a palette, but this in the stack script does nothing:
Code: Select all
on openStack
palette me
end openStack
-
bn
- VIP Livecode Opensource Backer

- Posts: 4171
- Joined: Sun Jan 07, 2007 9:12 pm
Post
by bn » Thu Apr 25, 2024 6:07 pm
richmond62 wrote: ↑Thu Apr 25, 2024 4:41 pm
I should like a main stack to appear as a palette, but this in the stack script does nothing:
Code: Select all
on openStack
palette me
end openStack
try:
Code: Select all
on openStack
palette this stack
end openStack
Kind regards
Bernd
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10315
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Apr 25, 2024 8:13 pm
Richmond.
"Me" really cannot be used that way. It only refers to the object that contains a running handler. So you could make this work if you put your original handler in the stack script.
Craig
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10315
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Apr 25, 2024 8:17 pm
Well, more complicated than I thought.
If your handler is in the stack script, it does not work. But if it is this:
it work fine.
Craig
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10315
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Apr 25, 2024 8:19 pm
Well, more complicated than I thought.
If your handler is in the stack script, it does not work. The openStack handler fires but nothing happens. But if it is this in the stack script:
it work fine if you click on the card window.
Craig
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Thu Apr 25, 2024 10:27 pm
Use the stack's style property and you'll need no code at all.
-
stam
- Posts: 3069
- Joined: Sun Jun 04, 2006 9:39 pm
Post
by stam » Fri Apr 26, 2024 5:58 am
dunbarx wrote: ↑Thu Apr 25, 2024 8:19 pm
Well, more complicated than I thought.
If your handler is in the stack script, it does not work. The openStack handler fires but nothing happens. But if it is this in the stack script:
it work fine if you click on the card window.
Craig
I’ve always used
Code: Select all
Set the style of this stack to “palette”
and it always works fine in preOpenStack
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Fri Apr 26, 2024 6:39 am
stam wrote: ↑Fri Apr 26, 2024 5:58 am
I’ve always used
Code: Select all
Set the style of this stack to “palette”
and it always works fine in preOpenStack
Best of all, the style property is persistent. Set it once, save it, and that's the mode it'll open in forever.
-
stam
- Posts: 3069
- Joined: Sun Jun 04, 2006 9:39 pm
Post
by stam » Fri Apr 26, 2024 6:42 am
FourthWorld wrote: ↑Fri Apr 26, 2024 6:39 am
Best of all, the style property is persistent. Set it once, save it, and that's the mode it'll open in forever.
Sure.
However sometimes it’s of value to do this conditionally, especially especially when working on the stack.
For example, prefixing that statement with
Code: Select all
if the optionKey is not down then…
I just posted what code works for me. But sure, if no need to set this dynamically I just set this in the property inspector for the stack…
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Fri Apr 26, 2024 8:01 am
Yes, it's good to have options.