Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b104f5852a513dec0a032801915940c9b622c4f9
Ticket: 699642ffffffffffffffffffffffffffffffffff
Tk 8.4.1 - bug in text widget multi-click behaviour
User & Date: brianpass on 2003-03-07 21:39:35
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    There's a discrepancy between the text widget 
    behaviour documented in
    the man pages and the Tk 8.4.1 implementation.  The 
    man page
    description of the bindings has :
    
    .IP [2]
    Double-clicking with mouse button 1 selects the word 
    under the mouse
    and positions the insertion cursor at the beginning of 
    the word.
    Dragging after a double click will stroke out a selection 
    consisting
    of whole words.
    .IP [3]
    Triple-clicking with mouse button 1 selects the line 
    under the mouse
    and positions the insertion cursor at the beginning of 
    the line.
    Dragging after a triple click will stroke out a selection 
    consisting
    of whole lines.
    
    However, text.tcl has :
    
    bind Text <Double-1> {
        set tk::Priv(selectMode) word
        tk::TextSelectTo %W %x %y
        catch {%W mark set insert sel.last}
    }
    
    bind Text <Triple-1> {
        set tk::Priv(selectMode) line
        tk::TextSelectTo %W %x %y
        catch {%W mark set insert sel.last}
    }
    
    For reasons we are all only too familiar with the 
    observed behaviour
    conforms with the code rather than the 
    documentation, and so the
    insert cursor is positioned at the end of the word or at 
    the
    beginning of the next line for double and triple clicks 
    respectively.
    
    Is anyone aware of any reasons why this cannot simply 
    be rectified
    with:
    
    bind Text <Double-1> {
        set tk::Priv(selectMode) word
        tk::TextSelectTo %W %x %y
        catch {%W mark set insert sel.first}
    }
    
    bind Text <Triple-1> {
        set tk::Priv(selectMode) line
        tk::TextSelectTo %W %x %y
        catch {%W mark set insert sel.first}
    }
    
    
    Regards,
    Brian Passingham, Passingham Software Ltd
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "brianpass"
  9. subsystem changed to: "None"
  10. title changed to:
    Tk 8.4.1 - bug in text widget multi-click behaviour
    
  11. type changed to: "Bug"