Just a note for future implementations, never use a hardcoded value of a 
window, it has caused so many 
problems... instead use it's variable name... 
And about the [winfo parent [winfo parent $clcanvas]] that is SO wrong... as 
soon as we changed the new CL from 
an independant window, it broke of course since the path is not the same 
anymore... the best way to this is (and 
that's trick I wanted to tell) :
[winfo toplevel $clcanvas]

with [winfo toplevel] you directly get the parent toplevel of a widget, that 
should be transparent to us...

KKRT

On Mon, Dec 18, 2006 at 02:06:06PM -0800, [EMAIL PROTECTED] wrote:
> Revision: 7680
>           http://svn.sourceforge.net/amsn/?rev=7680&view=rev
> Author:   billiob
> Date:     2006-12-18 14:05:29 -0800 (Mon, 18 Dec 2006)
> 
> Log Message:
> -----------
> add scroll bindings in the CL on windows
> Should also work on tcl 8.5 ! I need someone to test it !
> We can't bind with MouseWheel a widget, but only a root window with TK8.4 
> according to http://www.tcl.tk/man/tcl8.4/TkCmd/bind.htm#M9, but seems to be 
> possible on tk8.5 : http://www.tcl.tk/man/tcl8.5/TkCmd/bind.htm#M9
> 
> Modified Paths:
> --------------
>     trunk/amsn/guicontactlist.tcl
> 
> Modified: trunk/amsn/guicontactlist.tcl
> ===================================================================
> --- trunk/amsn/guicontactlist.tcl     2006-12-18 21:40:56 UTC (rev 7679)
> +++ trunk/amsn/guicontactlist.tcl     2006-12-18 22:05:29 UTC (rev 7680)
> @@ -162,16 +162,23 @@
>                               ::guiContactList::moveBGimage 
> $::guiContactList::clcanvas
>                       }
>               } elseif {$tcl_platform(platform) == "windows"} {
> -                     # TODO: fix win bindings -> Arieh's job ;)
> -                     # bind $clcanvas <MouseWheel> {
> -                     #       ::guiContactList::scrollCL $clcanvas [expr {- 
> (%D)}]
> -                     # }
> -                     bind [winfo parent [winfo parent $clcanvas]] 
> <MouseWheel> {
> -                             if {%D >= 0} {
> -                                     ::guiContactList::scrollCL 
> $::guiContactList::clcanvas up
> -                             } else {
> -                                     ::guiContactList::scrollCL 
> $::guiContactList::clcanvas down
> +                     #TODO: test it with tcl8.5
> +                     if {$::tcl_version >= 8.5} {
> +                             bind $clcanvas <MouseWheel> {
> +                                     if {%D >= 0} {
> +                                             ::guiContactList::scrollCL 
> $::guiContactList::clcanvas up
> +                                     } else {
> +                                             ::guiContactList::scrollCL 
> $::guiContactList::clcanvas down
> +                                     }
>                               }
> +                     } else {
> +                             bind . <MouseWheel> {
> +                                     if {%D >= 0} {
> +                                             ::guiContactList::scrollCL 
> $::guiContactList::clcanvas up
> +                                     } else {
> +                                             ::guiContactList::scrollCL 
> $::guiContactList::clcanvas down
> +                                     }
> +                             }
>                       }
>               } else {
>                       # We're on X11! (I suppose ;))
> 
> 
> This was sent by the SourceForge.net collaborative development platform, the 
> world's largest Open Source development site.
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Amsn-commits mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/amsn-commits

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to