Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to check if Tray is available
How to check if Tray is available [message #437159] Sat, 29 May 2004 17:23 Go to next message
Max is currently offline MaxFriend
Messages: 28
Registered: July 2009
Junior Member
The documentation for Tray says "Instances of this class represent the
system tray that is part of the task bar status area on some operating
systems."

I haven't got access to a "non system tray" OS to check this atm, so how
do I determine if the OS has this feature available (or not)?

--
Regards Max rotvel AT bolignet-aarhus DOT dk
Re: How to check if Tray is available [message #437160 is a reply to message #437159] Sat, 29 May 2004 19:25 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
And along the same lines, is there anyway to use the MacOS X 'tray'
feature? It's not exactly the sort of implementation as all other
platforms, but it still exists. I think it should be usable. Perhaps
the TrayItem class could be given a method setMenu(Menu) which is
implemented on all platforms. This could make it possible to access the
contectual menu on app icons in the Dock.

Daniel

Max wrote:

>The documentation for Tray says "Instances of this class represent the
>system tray that is part of the task bar status area on some operating
>systems."
>
>I haven't got access to a "non system tray" OS to check this atm, so how
>do I determine if the OS has this feature available (or not)?
>
>
>
Re: How to check if Tray is available [message #437176 is a reply to message #437159] Mon, 31 May 2004 12:48 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
There is not api for this. You should just assume that it is there, and if
it isn't then the implementation will ultimately no-op (but you should not
need to do anything different).

Grant

"Max" <this@address.is.invalid> wrote in message
news:MPG.1b22e56b1c0b9020989680@news.eclipse.org...
>
> The documentation for Tray says "Instances of this class represent the
> system tray that is part of the task bar status area on some operating
> systems."
>
> I haven't got access to a "non system tray" OS to check this atm, so how
> do I determine if the OS has this feature available (or not)?
>
> --
> Regards Max rotvel AT bolignet-aarhus DOT dk
Re: How to check if Tray is available [message #437178 is a reply to message #437176] Mon, 31 May 2004 13:43 Go to previous messageGo to next message
Stefan Zeiger is currently offline Stefan ZeigerFriend
Messages: 102
Registered: July 2009
Senior Member
Grant Gayed wrote:

> There is not api for this. You should just assume that it is there, and if
> it isn't then the implementation will ultimately no-op (but you should not
> need to do anything different).

Well, if you want to close all windows and have your program run in the
background with only a tray item to show status information and to
(re-)open the main window, you need to be sure that the tray item is
really displayed, or you risk leaving your application running without
any means to control it.

--
Stefan Zeiger http://www.szeiger.de http://www.novocode.com
My SWT controls: http://www.novocode.com/swt
Re: How to check if Tray is available [message #437189 is a reply to message #437178] Mon, 31 May 2004 15:26 Go to previous messageGo to next message
David Thomson is currently offline David ThomsonFriend
Messages: 65
Registered: July 2009
Member
Maybe try to dispose it once right after creating it and catch an
exception? Not particularly elegant...
Re: How to check if Tray is available [message #437211 is a reply to message #437178] Tue, 01 June 2004 12:26 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
True, I've logged https://bugs.eclipse.org/bugs/show_bug.cgi?id=64923 and
CC'd you.

Grant

"Stefan Zeiger" <szeiger@novocode.com> wrote in message
news:c9fcap$sis$1@eclipse.org...
> Grant Gayed wrote:
>
> > There is not api for this. You should just assume that it is there, and
if
> > it isn't then the implementation will ultimately no-op (but you should
not
> > need to do anything different).
>
> Well, if you want to close all windows and have your program run in the
> background with only a tray item to show status information and to
> (re-)open the main window, you need to be sure that the tray item is
> really displayed, or you risk leaving your application running without
> any means to control it.
>
> --
> Stefan Zeiger http://www.szeiger.de http://www.novocode.com
> My SWT controls: http://www.novocode.com/swt
Re: How to check if Tray is available [message #437278 is a reply to message #437211] Wed, 02 June 2004 05:35 Go to previous messageGo to next message
Max is currently offline MaxFriend
Messages: 28
Registered: July 2009
Junior Member
I was going to say exactly the same thing, so thanks for doing that. It
doesn't have to be anything fancy - Display.getSystemTray() could simply
return null if no tray is available on that platform.

In meantime will the (rather nasty :-)) workaround David Thomson
proposed work? Ie: "Maybe try to dispose it once right after creating it
and catch an exception?"

Max


In article <c9hs7p$e8l$1@eclipse.org>, grant_gayed@ca.ibm.com says...
> True, I've logged https://bugs.eclipse.org/bugs/show_bug.cgi?id=64923 and
> CC'd you.
>
> Grant
>
> "Stefan Zeiger" <szeiger@novocode.com> wrote in message
> news:c9fcap$sis$1@eclipse.org...
> > Grant Gayed wrote:
> >
> > > There is not api for this. You should just assume that it is there, and
> if
> > > it isn't then the implementation will ultimately no-op (but you should
> not
> > > need to do anything different).
> >
> > Well, if you want to close all windows and have your program run in the
> > background with only a tray item to show status information and to
> > (re-)open the main window, you need to be sure that the tray item is
> > really displayed, or you risk leaving your application running without
> > any means to control it.
> >
> > --
> > Stefan Zeiger http://www.szeiger.de http://www.novocode.com
> > My SWT controls: http://www.novocode.com/swt
>
>
>
Re: How to check if Tray is available [message #437487 is a reply to message #437160] Fri, 04 June 2004 20:15 Go to previous message
Brion Vibber is currently offline Brion VibberFriend
Messages: 21
Registered: July 2009
Junior Member
Daniel Spiewak wrote:
> And along the same lines, is there anyway to use the MacOS X 'tray'
> feature? It's not exactly the sort of implementation as all other
> platforms, but it still exists. I think it should be usable. Perhaps
> the TrayItem class could be given a method setMenu(Menu) which is
> implemented on all platforms. This could make it possible to access the
> contectual menu on app icons in the Dock.

I've filed an enhancement request in bugzilla for Tray-dock support:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=65801

-- brion vibber (brion @ pobox.com)
Previous Topic:Cannot Run SWT app
Next Topic:Tree/TreeViewer Cut/Copy/Paste
Goto Forum:
  


Current Time: Tue Sep 24 02:26:43 GMT 2024

Powered by FUDForum. Page generated in 0.05035 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top