Simple System Tray Icon

3

3c273

Hello,
I have a short looping script that runs in the background (Windows 2000) and
I want to have a tray icon so I know that it is running. I have looked at
wxTaskBarIcon and the examples on the web and in the demo, but it seems
pretty complex and I haven't had any success even getting one to show up.
Can someone point me to a simple example that just shows an icon? I don't
need it to anything but show up. Any help is appreciated.
Louis
 
M

Michele Petrazzo

3c273 said:
Hello, I have a short looping script that runs in the background
(Windows 2000) and I want to have a tray icon so I know that it is
running. I have looked at wxTaskBarIcon and the examples on the web
and in the demo, but it seems pretty complex and I haven't had any
success even getting one to show up.

wxTaskBarIcon is very, very simple!
Into the demo, inside 80 line, you can find all the taskbar work, the
menu connected with the rclick and its image change...
Where do you find this complex?

Try to make the windows taskbar with the win32 api ... :)
Can someone point me to a simple example that just shows an icon? I
don't need it to anything but show up. Any help is appreciated.

Copy and paste that lines into your code and remove the lines that you
don't need. I think that with 15/20 lines you will your taskbar work!


Michele
 
T

Thomas Heller

3c273 said:
Hello,
I have a short looping script that runs in the background (Windows 2000) and
I want to have a tray icon so I know that it is running. I have looked at
wxTaskBarIcon and the examples on the web and in the demo, but it seems
pretty complex and I haven't had any success even getting one to show up.
Can someone point me to a simple example that just shows an icon? I don't
need it to anything but show up. Any help is appreciated.
Louis
Simon Bruning has made something that should you get started.

http://www.brunningonline.net/simon/blog/archives/001835.html

Thomas
 
3

3c273

Michele Petrazzo said:
wxTaskBarIcon is very, very simple!
Into the demo, inside 80 line, you can find all the taskbar work, the
menu connected with the rclick and its image change...
Where do you find this complex?

I guess since it is in a class and I am not very familiar with OOP. I was
hoping there was a simple procedural way to do something like:

myIcon=wx.TaskBarIcon('path to my icon file')
myIcon.ShowIcon()

but I guess it's not that simple. Thanks for your reply, I will keep trying.
Try to make the windows taskbar with the win32 api ... :)

I saw an example of that. No thanks!

Thanks again.
Louis
 
S

Simon Brunning

I guess I should have capitalized the word 'simple' in my request :) Thanks
for your reply. I had already found this and it made the wx example look
like a one-liner. I didn't realize that this was such a chore. Thanks again,
I will keep trying.
Louis

This is untested, 'cos I'm on a Mac these days, but what you want
should look something like:

from SysTrayIcon import SysTrayIcon
icon = SysTrayIcon('parh/to/icon.ico', "Hover text", {})

How simple do you want?
 
3

3c273

This is untested, 'cos I'm on a Mac these days, but what you want
should look something like:

from SysTrayIcon import SysTrayIcon
icon = SysTrayIcon('parh/to/icon.ico', "Hover text", {})

How simple do you want?


That's what I wanted. I just couldn't figure out how to use it. Thanks a
bunch.
Louis
 
3

3c273

----quoted----
This is untested, 'cos I'm on a Mac these days, but what you want
should look something like:

from SysTrayIcon import SysTrayIcon
icon = SysTrayIcon('parh/to/icon.ico', "Hover text", {})

How simple do you want?

----/quoted----

I guess I still don't get it. The code you supplied creates an icon and then
hangs.

from SysTrayIcon import SysTrayIcon
icon = SysTrayIcon('PathToMyIcon', "My Application",())
while 1:
DoStuff()

DoStuff doesn't do happen until I choose 'QUIT' from the icon menu. Any
help? I feel like I'm missing something really fundamental here. Thanks
again.

Louis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top