Minimize problem

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

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Minimize problem

Post by bidgeeman » Thu Jun 04, 2009 10:03 am

Hello.

I've searched and reas a few posts here about the minimize function but none address this problem. I downloaded the u3_example stack stack to see how the minimize button works on a skinned stack with no taskbar.
I have a stack that is simlar, so I set up a minimize button with the code I found in the u3_example stack:

Code: Select all

on mouseUp
  set the iconic of this stack to true
end mouseUp
Problem is. When the stack is inimized it does not go into the taskbar but gets placed at the bottom of the screen and sits slightly above the taskbar:

Image

How do I ge the stack to function like a normal Rev taskbar?


Thanks again
Bidge

Klaus
Posts: 14192
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Jun 04, 2009 10:31 am

Hi Bidge,

I am afraid this is a bug and cannot be worked around!
Iconify will only work with stacks that have a titlebar, not with skinned stacks, sorry.


Regards

Klaus

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Thu Jun 04, 2009 10:40 am

Hello Klaus.
Many thanks for the reply. What a pity. I hope there is a fix soon.

Cheers
Bidge

Klaus
Posts: 14192
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Jun 04, 2009 12:46 pm

Hi Bidge,

I have an untested but clever idea! :-D

1. Create a stack with the same name as your skinned stack & "_trigger", but set its TITLE to the same name as your skinned stack!
1.b. put this into the stack script of your "trigger" stack:
on uniconifyStack
hide this stack
show stack "name of your skinned stack"
end uniconifyStack

2. When your skinned stack opens, open that stack INVISIBLE -> go invisible stack XYZ
3. Now the smart trick:
When the user clicks the "iconify" button in your skinned stack:
a. hide your skinned stack
b. iconify your "trigger" stack
-> set the iconic of stack "trigger stack" to true

Now what I mean?
To the user it will look as if your skinned stack has been iconified, since the name in the taskbar is identical.

As I said, this is not tested, but sounds doable and is at least worth a try :-)

Best

Klaus

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Thu Jun 04, 2009 1:25 pm

Wow,.....great idea Klaus. I barely understand how to script it ,but I do understand the concept. Thank you so much for spending the time thinking of this wonderful workaround. :)

Cheers
Bidge

Klaus
Posts: 14192
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Jun 04, 2009 1:35 pm

Hi Bidge,

that's pretty straightforward!

1. Put this into the script of your "trigger" stack:

Code: Select all

on uniconifyStack 
  hide this stack 
  show stack "name of your skinned stack" 
end uniconifyStack


2. And this into the script of your custom "iconify" button of your skinned stack:

Code: Select all

on mouseup
## Simply hide this stack:
  hide this stack

## And now iconify the "trigger" stack instead
 set the iconic of stack "trigger stack" to true 
end mouseup
Both stacks MUST be open, of ocurse!

Please tell me if that works for you!
I am not sure if invisible stacks do appear in the task bar when iconified, I am a hard-core Mac-user ;-)


Best

Klaus

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Thu Jun 04, 2009 2:02 pm

Hello Klaus.
Sorry....how do you place a stack inside another stack? I am a newbie and only at the card stage. I understand how cards can be placed inside stacks but not other stacks....very sorry for such a basic question.

Cheers
Bidge

Klaus
Posts: 14192
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Jun 04, 2009 2:05 pm

Hi Bidge,

I am talking about two SEPARATE stacks, NOT substack!

Klaus
Posts: 14192
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Jun 04, 2009 2:41 pm

CORRECTION! :-)

Go to your skinned stack and then choose from the Rev menu "File"
-> New Substack of Stack "your skinned stackname here"

Now you have a Stack in a Stack, which is called substack :-)

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Thu Jun 04, 2009 11:49 pm

Hello Klaus.

Sorry to report it did'nt work. When I clicked the iconify button everything dissapeared. Nothing was on the task bar at all. I had to kill the exe from Task Manager. :(

Cheers
Bidge

Klaus
Posts: 14192
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Fri Jun 05, 2009 8:30 am

Hi Bidge,

sorry to hear, but the idea was great ;-)

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Fri Jun 05, 2009 9:13 am

Hi Klaus. Very imaginative solution you had there! Thank you so much for considering the problem. Do you develop many audio applications yourself?

Cheers
Bidge

Klaus
Posts: 14192
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sat Jun 06, 2009 11:32 am

Hi Bidge,
bidgeeman wrote:Hi Klaus. Very imaginative solution you had there!
Thank you so much for considering the problem.
I have another idea :-D

I think the crash had to do with the fact that we were iconizing an invisible stack(?)
If that really is the case then you could try this, if you like:
Instead of opening the "trigger" stack invisible, we could set its rect to
somehwere "out of reach" :-)

Try this:
Script of "trigger" stack:

Code: Select all

on uniconifyStack 
  set the rect of me to 9999,9999,10000,10000
  ## So this stack is only 1*1 pixel and way out of sight
  show stack "name of your skinned stack" 
end uniconifyStack
2. And this into the script of your custom "iconify" button of your skinned stack:

Code: Select all

on mouseup 
## Simply hide this stack: 
  hide this stack 

## And now iconify the "trigger" stack instead 
 set the iconic of stack "trigger stack" to true 
end mouseup
And you need open the trigger stack with something like this:

Code: Select all

...
 set the rect of stack "trigger" to 9999,9999,10000,10000
 go stack "trigger"
... 
Might work :-D
bidgeeman wrote:Do you develop many audio applications yourself?
None at all, actually :-)


Best

Klaus

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Sat Jun 06, 2009 11:42 am

Hi Klaus.
Forgive my basic questions as I am a new user but where do I put the third piece of code?

Code: Select all

 set the rect of stack "trigger" to 9999,9999,10000,10000 
 go stack "trigger" 
Cheers
Bidge

Klaus
Posts: 14192
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sat Jun 06, 2009 11:48 am

Hi Bidge,

Thou shalt be forgiven! :-D

OK, to make this concept work you need to open both stacks at the same time.
So you could put this into the "openstack" handler of your skinned stack.


Best

Klaus

Post Reply