Home > Archive > Tcl > July 2004 > Tray Icon handling under Linux
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Tray Icon handling under Linux
|
|
| Rob Strover 2004-07-03, 8:56 am |
| In this NG I learnt about the 'winico' extension for handling System Tray
(Notification Area) applications and their icons under Windows.
Is there an equivalent extension for Linux which works at least with KDE,
but hopefully also with the GNOME environment? Adherence to the
freedesktop.org specification for the systray would be extremely welcome.
Any suggestions would be most welcome.
TIA
Rob.
| |
| Daniel 2004-07-03, 3:58 pm |
| You may want to take a look at how the AMSN guys do it :
amsn.sf.net
take a lock at dock.tcl and plugins/gnomedock iirc
Something like this coming standard in Tk would be great (I am adding
suggestion in Wiki)
> In this NG I learnt about the 'winico' extension for handling System Tray
> (Notification Area) applications and their icons under Windows.
>
> Is there an equivalent extension for Linux which works at least with KDE,
> but hopefully also with the GNOME environment? Adherence to the
> freedesktop.org specification for the systray would be extremely welcome.
>
> Any suggestions would be most welcome.
>
> TIA
>
> Rob.
| |
| Rob Strover 2004-07-04, 5:44 am |
| "Daniel" <daniel@rawbyte.com> wrote in message
news:234e16a2.0407030648.37536c00@posting.google.com...[color=darkred]
> You may want to take a look at how the AMSN guys do it :
> amsn.sf.net
> take a lock at dock.tcl and plugins/gnomedock iirc
>
> Something like this coming standard in Tk would be great (I am adding
> suggestion in Wiki)
>
Tray[color=darkred]
KDE,[color=darkred]
welcome.[color=darkred]
Daniel
Thank you for your help. I noticed this application some time ago and it
was what initially made me interested in how to program systray usage under
Linux using tcl/tk. In fact, it was one of the main reasons why I started
using tcl.
I had hoped that someone had already created a tcl/tk extension that catered
for at least the KDE system tray in the same way that winico does for MS
Windows. I'd do some work in this direction but my knowledge of C is most
likely *not* at a sufficiently high level . In any case, the appropriate
code is available from within the installed amsn directories and I will
study it to work out its 'secrets'.
Thanks again.
Rob.
| |
| Mark G. Saye 2004-07-04, 3:56 pm |
| Rob Strover wrote:
> In this NG I learnt about the 'winico' extension for handling System Tray
> (Notification Area) applications and their icons under Windows.
>
> Is there an equivalent extension for Linux which works at least with KDE,
> but hopefully also with the GNOME environment? Adherence to the
> freedesktop.org specification for the systray would be extremely welcome.
>
> Any suggestions would be most welcome.
The 'KDE' page on the wiki http://wiki.tcl.tk/3935 mentions the Tk_Theme
package written by George Peter Staplin which includes a KDE sytem tray
utility. Unfortunately, the Tk_Theme page at http://wiki.tcl.tk/4712
notes that the 'project has been removed from the public server'. Too bad.
Maybe you could contact GPS directly and ask him for a copy? You'll have
to find his email address from somewhere (might be worth looking through
this newsgroup)
Otherwise, I'm sure somebody else might have a copy of Tk_Theme.
Good luck,
Mark /
--
Mark G. Saye
markgsaye @ yahoo.com
| |
| George Peter Staplin 2004-07-04, 8:57 pm |
| on Rob wrote:
> In this NG I learnt about the 'winico' extension for handling System Tray
> (Notification Area) applications and their icons under Windows.
>
> Is there an equivalent extension for Linux which works at least with KDE,
> but hopefully also with the GNOME environment? Adherence to the
> freedesktop.org specification for the systray would be extremely welcome.
>
> Any suggestions would be most welcome.
>
> TIA
>
> Rob.
I wrote the Tk_Theme package Mark mentioned. The basic code needed to
embed a Tk toplevel in the KDE systray is:
if (kdeSystray)
screenName = "";
tkwin = Tk_CreateWindowFromPath (interp, tkmain, path, screenName);
if (NULL == tkwin)
return TCL_ERROR;
if (kdeSystray) {
Atom kde_net_wm_system_tray_window_for = XInternAtom
(wPtr->dis, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False);
Window parent;
Window root;
Window *children;
int nchildren = 0;
Tk_SetWindowBorderWidth (tkwin, 0);
Tk_MapWindow (tkwin);
/*This finds the real parent that is created by the Tk
WM code when Tk_MapWindow is called.
*/
XQueryTree (wPtr->dis, wPtr->xWin, &root, &parent,
&children, &nchildren);
XFree (children);
Tk_UnmapWindow (tkwin);
XSetWindowBorderWidth (wPtr->dis, parent, 0);
XChangeProperty (wPtr->dis, parent,
kde_net_wm_system_tray_window_for,
XA_WINDOW, 32, PropModeReplace,
(unsigned char *) &parent, 1);
Tk_MapWindow (tkwin);
}
You can redistribute/modify/use that code under the same terms as Tcl.
Happy Tcl'ing,
George
|
|
|
|
|