On Fri, 2010-04-23 at 16:37 +0200, Alexander Nestorov wrote:
> Hi, thanks for sending this here.
> This is a known bug and it will be fixed when possible. Trayicon code
> should be rewritten, but currently nobody is working on it.
> 
> Regards
> 
Try <http://tktray.googlecode.com/files/tktray1.3.6.tar.gz> + following
diff. For me i only see 2 problems:
1) no tooltip
2) if the image is smaller then 24x24 px transparancy seems odd


$ svn diff
Index: trayicon.tcl
===================================================================
--- trayicon.tcl        (revision 12029)
+++ trayicon.tcl        (working copy)
@@ -87,14 +87,14 @@
                set iconmenu .trayiconwin.immain
 
        } elseif {[UnixDock]} {
-               if { [catch {package require libtray} res] } {
+               if { [catch {package require tktray} res] } {
                        set systemtray_exist 0
                        status_log "[trans traynotcompiled] : $res"
                        close_dock
                        return
                }
 
-               set systemtray_exist [systemtray_exist]; #a system tray exist?
+               set systemtray_exist 1; #a system tray exist?
 
                destroy .immain
                set iconmenu .immain
@@ -251,9 +251,8 @@
                if { $systemtray_exist == 1 && $statusicon == 0 && $status != 
"REMOVE" && [UnixDock]} {
                        set pixmap "[::skin::GetSkinFile pixmaps doffline.png]"
                        image create photo statustrayicon -file $pixmap
-                       image create photo statustrayiconres
                        #add the icon
-                       set statusicon [newti .si -tooltip "[trans offline]" 
-pixmap statustrayiconres -command "::trayicon_callback statustrayicon 
statustrayiconres"]
+                       set statusicon [tktray::icon .si -image statustrayicon]
 
                        bind .si <<Button1>> iconify_proc
                        bind .si <<Button3>> "tk_popup $iconmenu %X %Y"
@@ -281,7 +280,6 @@
                        if {[UnixDock] } {
                                catch {
                                        image delete statustrayicon
-                                       image delete statustrayiconres
                                }
                        }
                }
@@ -407,9 +405,7 @@
 
                        } elseif {[UnixDock] } {
                                if { $pixmap != "null"} {
-                                       configureti $statusicon -tooltip 
$tooltip
                                        image create photo statustrayicon -file 
$pixmap
-                                       image create photo statustrayiconres
                                }
                        } elseif {[MacDock] } {
                                if { $pixmap == "null"} {
@@ -536,7 +532,6 @@
             if { $pixmap != "null"} {
                 configureti $statusicon -tooltip $tooltip
                 image create photo statustrayicon -file $pixmap
-                image create photo statustrayiconres
             }
         } elseif {[MacDock] } {
             if { $pixmap == "null"} {
@@ -587,8 +582,7 @@
                        set mailicon 1
                } elseif {[UnixDock] } {
                        image create photo mailtrayicon -file $pixmap
-                       image create photo mailtrayiconres
-                       set mailicon [newti .mi -tooltip offline -pixmap 
mailtrayiconres -command "::trayicon_callback mailtrayicon mailtrayiconres"]
+                       set mailicon [tktray::icon .mi -image mailtrayicon]
 
                        bind .mi <Button-1> "::hotmail::hotmail_login"
                        bind .mi <Enter> [list balloon_enter %W %X %Y $msg]
@@ -609,7 +603,6 @@
                        if {[UnixDock] } {
                                catch {
                                        image delete mailtrayicon
-                                       image delete mailtrayiconres
                                }
                        }
                }



------------------------------------------------------------------------------

_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to