Hello,
First, congratulations vivia for the empty copy paste, lol
second, about tjikkun's Q/A, wrong answer because [package require Tk] > 8.3 
means that it loads Tk, then checks 
if it's > 8.3, it doesn't mean only a Tk > 8.3 will be loaded, so Tk will 
always be loaded this way...
About the check to 8.4, it's good but I was just wondering why 8.4.13.. is it 
that 8.4.13 has the fix in Tk 
itself ? Also, I was wondering if the bind is needed since binding to 
::tk::TextKeySelect is the default, so no 
need to overide, right ? and finally, I don't really like the overriding of Tk 
procs, I would realy prefer it to 
be :
proc my_TextKeySelect { .. .} { 
if { < 8.4.13 } { 
 ....
} else {
 eval ::tk::TextKeySelect $args ..
 }

what do you think?


KKRT

On Mon, Dec 18, 2006 at 06:20:41AM -0800, [EMAIL PROTECTED] wrote:
> Revision: 7675
>           http://svn.sourceforge.net/amsn/?rev=7675&view=rev
> Author:   tjikkun
> Date:     2006-12-18 06:20:41 -0800 (Mon, 18 Dec 2006)
> 
> Log Message:
> -----------
> TextKeySelect for older tk version ok now?
> 
> Modified Paths:
> --------------
>     trunk/amsn/amsn
>     trunk/amsn/amsncore.tcl
>     trunk/amsn/chatwindow.tcl
> 
> Modified: trunk/amsn/amsn
> ===================================================================
> --- trunk/amsn/amsn   2006-12-18 14:20:07 UTC (rev 7674)
> +++ trunk/amsn/amsn   2006-12-18 14:20:41 UTC (rev 7675)
> @@ -52,7 +52,8 @@
>        or better to run aMSN. Please upgrade."  -icon warning
>       exit
>  }
> -#TODO: can't this be done in 1 check like "[package require Tk] > 8.3" ?
> +#Q: can't this be done in 1 check like "[package require Tk] > 8.3" ?
> +#A: not on windows because you want any version of Tk to be loaded to show 
> the messagebox
>  
>  ############################################################
>  ### Hide the main window until it has been fully displayed
> 
> Modified: trunk/amsn/amsncore.tcl
> ===================================================================
> --- trunk/amsn/amsncore.tcl   2006-12-18 14:20:07 UTC (rev 7674)
> +++ trunk/amsn/amsncore.tcl   2006-12-18 14:20:41 UTC (rev 7675)
> @@ -217,32 +217,33 @@
>  # new -              A new position for the insertion cursor (the cursor 
> hasn't
>  #            actually been moved to this position yet).
>  
> -proc my_TextKeySelect {w new} {
> -
> -    if {[$w tag nextrange sel 1.0 end] eq ""} {
> -        if {[$w compare $new < insert]} {
> -            $w tag add sel $new insert
> -        } else {
> -            $w tag add sel insert $new
> -        }
> -        $w mark set tk::anchor$w insert
> -    } else {
> -        if {[$w compare $new < tk::anchor$w]} {
> -            set first $new
> -            set last tk::anchor$w
> -        } else {
> -            set first tk::anchor$w
> -            set last $new
> -        }
> -        $w tag remove sel 1.0 $first
> -        $w tag add sel $first $last
> -        $w tag remove sel $last end
> -    }
> -    $w mark set insert $new
> -    $w see insert
> -
> -    update idletasks 
> +if { $::tk_patchLevel < "8.4.13" } {
> +proc ::tk::TextKeySelect {w new} {
> +     if {[string equal [$w tag nextrange sel 1.0 end] ""]} {
> +             if {[$w compare $new < insert]} {
> +                     $w tag add sel $new insert
> +             } else {
> +                     $w tag add sel insert $new
> +             }
> +             $w mark set anchor insert
> +     } else {
> +             if {[$w compare $new < anchor]} {
> +                     set first $new
> +                     set last anchor
> +             } else {
> +                     set first anchor
> +                     set last $new
> +             }
> +             $w tag remove sel 1.0 $first
> +             $w tag add sel $first $last
> +             $w tag remove sel $last end
> +     }
> +     $w mark set insert $new
> +     $w see insert
> +     
> +     update idletasks
>  }
> +}
>  
>  
>  
> #///////////////////////////////////////////////////////////////////////////////
> 
> Modified: trunk/amsn/chatwindow.tcl
> ===================================================================
> --- trunk/amsn/chatwindow.tcl 2006-12-18 14:20:07 UTC (rev 7674)
> +++ trunk/amsn/chatwindow.tcl 2006-12-18 14:20:41 UTC (rev 7675)
> @@ -2031,8 +2031,8 @@
>               bind $text <Key-BackSpace> "::amsn::DeleteKeyPressed $w $text 
> %K"
>               bind $text <Key-Up> {my_TextSetCursor %W [::amsn::UpKeyPressed 
> %W]; break}
>               bind $text <Key-Down> {my_TextSetCursor %W 
> [::amsn::DownKeyPressed %W]; break}
> -             bind $text <Shift-Key-Up> {my_TextKeySelect %W 
> [::amsn::UpKeyPressed %W]; break}
> -             bind $text <Shift-Key-Down> {my_TextKeySelect %W 
> [::amsn::DownKeyPressed %W]; break}
> +             bind $text <Shift-Key-Up> {::tk::TextKeySelect %W 
> [::amsn::UpKeyPressed %W]; break}
> +             bind $text <Shift-Key-Down> {::tk::TextKeySelect %W 
> [::amsn::DownKeyPressed %W]; break}
>  
>               global skipthistime
>               set skipthistime 0
> 
> 
> 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