Page 1 of 1
Scripting a Minimize button
Posted: Thu Jun 26, 2008 7:23 pm
by gyroscope
Hi, could anyone tell me please: is it relatively straightforward to script for my own Minimize button on a Mac?
Also (excusing my ignorance here...

) what is the Windows alternative to Minimize and could that be scripted from a custom button as well?

Posted: Thu Jun 26, 2008 7:26 pm
by Klaus
Hi gyroscope,
that's pretty easy:
Code: Select all
...
set the iconic of stack "xyz" to true
...
Crossplatform solution, of course
Best
Klaus
New "bass" department:
http://www.major-k.de/bass
Posted: Thu Jun 26, 2008 11:41 pm
by gyroscope
Thank you Klaus, that seems straightforward enough!

Posted: Sun Jun 29, 2008 9:32 pm
by gyroscope
This works a treat when the Mac control/name/window bar (what
is it's official name?!) is there, but as soon as I make the controls empty (i.e gone), the emulating minimize button doesn't work....
So I'm guessing the control bar has to be hidden for it to work; after trying different seaches in the dictionary, I couldn't find any answer to how to do this. Any help here please!

Posted: Mon Jun 30, 2008 11:13 pm
by gyroscope
Hope its OK to bump this thread...
control/name/window bar (what is it's official name?!)
Title bar...tut!
Seriously, if anyone has an answer I'd appreciate this. I'm getting close, I think (but not close enough...)
Code: Select all
on preOpenStack
set the decorations of this stack to "minimize"
hide title
end preOpenStack
That doesn't work but I'm certain it can work as I've seen plugins with custom minimize, etc and no title bar showing...
Posted: Sat Nov 22, 2008 3:51 pm
by gyroscope
Hi, I've bumped this thread again....
In the five months that's passed, in my occasional Rev script trawlings, I still haven't discovered a way to script a minimize button without the title bar showing....
There's gotta be a way (to block buster...

)
Seriously, if anyone could tell me this quite straightforward scripting, I'm certain, I'd be reeeelly grateful....

Posted: Sat Nov 22, 2008 4:35 pm
by SparkOut
You must be about my generation there gyro!
I don't have a Mac so I can't guarantee this works in that environment (and I know there are some quirks about iconic display generally).
On Windows XP this seems to work for me:
Given a stack with the decorations set to empty, and a custom "title" bar or "controls area" you can:
Code: Select all
--in the stack script
on uniconifyStack
set the decorations of this stack to empty
end uniconifyStack
Code: Select all
--in the minimise button script
on mouseUp
lock screen --I still see a momentary animation of the window frame shrinking to the taskbar even so
set the decorations of this stack to Title --or default
set the iconic of this stack to true
end mouseUp
Posted: Sat Nov 22, 2008 5:31 pm
by gyroscope
Hi SparkOut
You must be about my generation there gyro!
They were the days! (Or not, depending how you look at it...

)
Thanks for your info but unfortunately it's not quite what I'm after: the iconic of the stack only seems to works if the title bar is showing but I don't want the title bar to show at all; but still want to iconify/collapse the window...

Posted: Sat Nov 22, 2008 5:51 pm
by BvG
so maybe you're after this?
Code: Select all
on mouseUp
set the iconic of this stack to true
end mouseUp
Posted: Sat Nov 22, 2008 6:16 pm
by gyroscope
Still no joy there, BvG but thanks still.
Perhaps I've confused people; I'll explain a bit better:
Make a new stack. This stack has a title bar as default. Put a button on it with the script you and Klaus suggested. Click the button and it works just fine. So far so good...
I go to the Controls on the stack inspector and make the title bar empty (or make it empty via script). The title bar disappears, as I want.
Click the button again....and nothing happens. It seems that the prerequisite of the "set the iconic" script to work is that the title bar is showing. But I don't want the title bar showing!!
But there must be a way, because I've seen Rev plugins with no title bar but the minimize button works (I can't inspect the script of any of these because they are locked somehow...)
Aayeee!! (As they say in Batman comics....er, perhaps)

Posted: Sat Nov 22, 2008 7:00 pm
by gyroscope
SparkOut, apologies here....I was getting so flustered about this I didn't read your script properly; it works pretty much as I need; (I put in unlock screen as well into your code); on the Mac there seems to be the same flashing before it goes to the Dock and after it's opened from the dock though but it's the closest yet...
Thank you!

Posted: Sat Nov 22, 2008 8:16 pm
by gyroscope
Judge: Did you, or did you not, try the stack with a custom window shape so that the title bar would be still active but not showing and so that the custom button to minimize should work?
Me: Yes, I tried this about 5 months ago, your honor blackman, but the custom button didn't work.
Judge: I see. And have you repeated this process?
Me: Yes, about ten minutes ago, real time.
Judge: Don't get funny with me, gyroscope or whatever you're called...did it work this time?
Me: Yes, it did.
Judge: Case dismissed!
