Minimize to system tray.

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Paul D
Posts: 116
Joined: Mon May 21, 2007 6:58 pm

Minimize to system tray.

Post by Paul D » Thu Oct 23, 2008 3:02 pm

I found this...

http://article.gmane.org/gmane.comp.ide ... ystem+tray

but that doesnt work. (does it work for anyone else?)

is it possible to minimize your standalone to the system tray. if not, is there a work around?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Fri Oct 24, 2008 5:51 am

Hi Paul,

It's difficult to determine what went wrong without checking he code - could you post a basic script that doesn't get the desired effect?

I'm sure we can figure it out together :-)

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Paul D
Posts: 116
Joined: Mon May 21, 2007 6:58 pm

Post by Paul D » Fri Oct 24, 2008 2:39 pm

sure, here is what i tried. i interpreted the link information above to just set an icon for your stack then set it to palette and you should have an icon in the system tray. so...

I set the icon of the stack then set it to palette...

set the icon of this stack to 1017
palette this stack
(also tried setting the palette first then the icon)

all that does is remove the window from my taskbar. no icon appears in the system tray. i also tried setting the icon to a image that came with revolution and one that i added via the image library. so i thought maybe i have to minimize the palette stack with the icon set...

if i minimize the palette stack with... "set the iconic of this stack to true"

This minimizes the program above my start button but I cant restore it.

Image

As you can see, restore is disabled. So is the maximize button. Double clicking the window does nothing and all I can do at this point is close the program.

I tried the same thing with modeless, no avail.

I would like to remove the window from my taskbar (which palette does) and put an icon in the system tray for my program next to outlook and my time, etc...

Image

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

Post by Klaus » Fri Oct 24, 2008 2:56 pm

Hi Paul,

sorry, looks like a misunderstanding!

From the docs about "icon":
Cross-platform note: On OS X systems, a stack's icon is displayed in the dock when the stack is minimized.
On Unix systems, the stack's icon is displayed on the desktop when the stack is iconified.
!!!!!
Setting a stack's icon property has no effect on Mac OS and Windows systems.!!!
!!!!!

In other words you cannot put a stack into the Windows tray with the build in capabilities of Rev.


Hope that helps.


Best

Klaus

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Oct 24, 2008 3:21 pm

Hi Paul,

Create a new stack. Call the stack "System Tray Sample". Add an image object with a 32x32 px picture and add a button. Set the ID of the image object to something unique, say 21006. Set the name of the button to "Backscript".

Set the script of the card to

Code: Select all

on preOpenStack
   insert the script of  btn "Backscript" into back
end preOpenStack

on unIconifyStack
   show this stack
   set the icon to 0
   pass unIconifyStack
end unIconifyStack

on iconifyStack
   send "hideme" to me in 0 millisecs -- bug 7531
   set the icon to 21006
   set the iconMenu to "Show Me|Show Me"
   pass iconifyStack
end iconifyStack

on hideMe
   hide stack "System Tray Sample"
end hideMe
Set the script of the button "Backscript" to

Code: Select all

on iconMenuPick theItem
   set the iconic of stack "System Tray Sample" to false
end iconMenuPick
This solution takes care of bug 7351. Be aware of bug 7350.

I have uploaded the stack to RevOnline, user name Mark.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Paul D
Posts: 116
Joined: Mon May 21, 2007 6:58 pm

Post by Paul D » Fri Oct 24, 2008 4:05 pm

Klaus wrote:Hi Paul,

sorry, looks like a misunderstanding!

From the docs about "icon":
Cross-platform note: On OS X systems, a stack's icon is displayed in the dock when the stack is minimized.
On Unix systems, the stack's icon is displayed on the desktop when the stack is iconified.
!!!!!
Setting a stack's icon property has no effect on Mac OS and Windows systems.!!!
!!!!!

In other words you cannot put a stack into the Windows tray with the build in capabilities of Rev.


Hope that helps.


Best

Klaus
hmm... you are right. i just assumed icon did something in windows in reference to the gmane link and the fact that is says All Platforms and platform support has the Windows Logo in the dictionary list and i didnt read all of the comments. oh well...


Thanks Mark I will check out your example.

Paul D
Posts: 116
Joined: Mon May 21, 2007 6:58 pm

Post by Paul D » Fri Oct 24, 2008 4:41 pm

Mark,

the example works fantastic.

how come you send hideme to itself? also, iconmenu is undocumented?

thanks again.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Oct 24, 2008 5:14 pm

Hi Paul,

The hideMe handler is a workaround for a bug. The iconMenu is "un"-documented in the Read Me files that come with Revolution.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm

Post by paul_gr » Fri Oct 24, 2008 9:55 pm

Thanks Mark,
that's brilliant.
I thought there was no way to do this in Rev.

Paul

maarten.koopmans
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 20
Joined: Sun Dec 28, 2008 3:26 pm

Post by maarten.koopmans » Sun Dec 28, 2008 3:29 pm

This is what I'm looking for as well, but I can't seem to create a nested menu.

Any thoughts/help appreciated!

--Maarten

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Post by RRobert » Tue Mar 03, 2009 7:01 am

Is there a way how I could get the iconmenu by a left click?

Robert

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Mar 03, 2009 10:31 am

Maarten,

It is possible to create a nested menu, but you need to use tabs and tags. Make sure to read the documentation in the Read Me files included with Revolution. It is under the header "Unsupported".

Btw, do you know about the Dutch Revolution forum?

Robert, I don't think there is a way to activate the icon menu on left-click. I wish I had this possibility, because currently I'm having some trouble with the icon menu. When I right-click on the icon menu, it shows the task bar menu as well as Revolution's icon menu, which is definitely not what I want.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply