Tk Source Code

View Ticket
Login
Ticket UUID: 220567
Title: Abbreviated Tk commands don't work with iWidgets
Type: Bug Version: final: 8.0.5
Submitter: welch Created on: 2000-10-31 23:45:09
Subsystem: 01. Bindings Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-03-28 05:49:52
Resolution: Fixed Closed By: dgp
    Closed on: 2001-03-27 22:49:52
Description:
OriginalBugID: 2422 Bug
Version: 8.0.5
SubmitDate: '1999-07-20'
LastModified: '1999-08-10'
Severity: CRIT
Status: Released
Submitter: jenn
ChangedBy: hobbs
OS: Solaris
OSVersion: 2.6
FixedDate: '1999-08-10'
FixedInVersion: 8.2
ClosedDate: '1999-08-05'


Name:  Krzysztof Kozminski

CVS:  RCS: @(#) $Id: tk.tcl,v 1.6 1999/01/04 19:25:27 rjohnson Exp $

ReproducibleScript:
    There is no simple way to reproduce it.  But the fix is trivial.
    

ObservedBehavior:
    In my application, Tk widget commands are hidden and replaced by Itcl
    classes with the same names; these are loosely based on Itk classes but,
    unlike Itk, they retain all Tk widget's attributes and methods (and have
    some additional ones).  For example, an Itcl class 'entry' has methods
    named bbox, cget, configure, delete, etc.  All that Itcl methods
    "inherited" from Tk widgets do, is pass the arguments to the Tk widgets
    associated with the Itcl object ($itk_hull in Itk).
    
    Unfortunately, while Tk widget methods can be abbreviated, Itcl object
    method do not seem to have this property.  So if I have, e,g. Tk entry
    .a-itk_hull and a corresponding Itcl object .a, I can do:
    
    .a-itk_hull icur end
    
    but the .a object requires full method name:
    
    .a icursor end.
    
    This breaks any code where the programmer was too lazy to type the full
    name of a Tk widget method.  The first example of this is in the
    aforementioned file (tk8.0/tk.tcl), in the procedure tkTabToWindow.
    

DesiredBehavior:
    I expect the code in the tcl libraries to have Tk widgets methods
    spelled out in full.
    

Patch:
*** /tmp/tk.tcl Tue Jul 13 10:41:35 1999
--- tk.tcl  Mon Jul 12 18:55:03 1999
***************
*** 186,193 ****
  
  proc tkTabToWindow {w} {
      if {"[winfo class $w]" == "Entry"} {
!   $w select range 0 end
!   $w icur end
      }
      focus $w
  }
--- 186,193 ----
  
  proc tkTabToWindow {w} {
      if {"[winfo class $w]" == "Entry"} {
!   $w selection range 0 end
!   $w icursor end
      }
      focus $w
  }


Comments:
    In case you're wondering why this was done, I wanteded to be able to
    extend the behavior of Tk widgets, including those in various public
    extensions (e.g. file selection dialog), without editing the code of the
    public extension each time it is updated.
    


This problem are fixed in 8.2b3. 
-- 08/10/1999 hobbs