icons in wxStatusBar

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
rex666
Earned a small fee
Earned a small fee
Posts: 20
Joined: Mon Nov 08, 2004 12:15 am

icons in wxStatusBar

Post by rex666 » Thu Mar 10, 2005 10:18 pm

Has anyone done this in a cross-platform way?

Thanks
-robin

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Fri Mar 11, 2005 7:45 am

wxTaskBarIcon ?
wxTaskBarIcon

This class represents a taskbar icon, appearing in the 'system tray' and responding to mouse clicks. An icon has an optional tooltip. Supported under most ports (wxMSW, wxGTK, wxMotif, wxX11, wxMac).

X Window System Note

Under X Window System, the window manager must support either the System Tray Protocol by freedesktop.org (WMs used by modern desktop environments such as GNOME >= 2, KDE >= 3 and XFCE >= 4 all do) or the older methods used in GNOME 1.2 and KDE 1 and 2. If it doesn't, the icon will appear as a toplevel window on user's desktop.

Because not all window managers have system tray, there's no guarantee that wxTaskBarIcon will work correctly under X Window System and so the applications should use it only as an optional component of their user interface. The user should be required to explicitly enable the taskbar icon on Unix, it shouldn't be on by default.
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Avi
Super wx Problem Solver
Super wx Problem Solver
Posts: 398
Joined: Mon Aug 30, 2004 9:27 pm
Location: Tel-Aviv, Israel

Post by Avi » Fri Mar 11, 2005 2:53 pm

Jorg, aren't the taskbar and application's status bar two different things? ;)

rex666, it is possible. You can see statusbar icons in the following xMule (which uses wxWidgets) screenshot: http://alts.homelinux.net/shots/19-0.jpg

I will look up some code in xMule and post it here.

Cursor
Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France
Contact:

Post by Cursor » Fri Mar 11, 2005 3:50 pm

Yes you can.
You can do it with a wxStatusBar derivation and with a wxPaintEvent interception inwitch you draw the icon bitmap.
You could derivate wxStatusBar to integrate a wxStaticBitmap control (the icon).

Avi
Super wx Problem Solver
Super wx Problem Solver
Posts: 398
Joined: Mon Aug 30, 2004 9:27 pm
Location: Tel-Aviv, Israel

Post by Avi » Fri Mar 11, 2005 7:33 pm

Yes, I agree, the best way is to simply insert a wxStaticBitmap into the wxStatusBar (since the status bar is derived from wxWindow)

Post Reply