The textbind move up and down error message

2025-12-26 Friday 2h 34 pm

I can't use my up and down keys. I get this error message: invalid command name "6.0" invalid command name "6.0" while executing "::textbind::moveUpDown .pw.right.ht up]"

    (command bound to event)

This was caused by a function coded by Chatbot GPT. I told them the problem and they asked me to insert this code in the function they coded:

# Function to handle moving up and down in the text widget
proc moveUpDown {direction} {
    # Get the current cursor position in the text widget
    set cursor_position [$top.txt index insert]
    
    # Move the cursor based on the direction (up or down)
    if {$direction == "up"} {
        # Move the cursor up by one line
        set new_position [string trimleft [expr {$cursor_position - 1}]]
    } elseif {$direction == "down"} {
        # Move the cursor down by one line
        set new_position [string trimleft [expr {$cursor_position + 1}]]
    }
    
    # Set the new cursor position
    $top.txt mark set insert $new_position
}

So far I don't get this error so I presume the problem was fixed.


TWu - 2026-01-01 20:55:01

Only if You provide all the bind command lines to this proc we can say more/something.