Tk Source Code

View Ticket
Login
Ticket UUID: 3c4435c9ae27f1cca9297f390828480f9e0885be
Title: tk entry on linux a paste does not replace a selection
Type: Bug Version: tk 8.6.9
Submitter: anonymous Created on: 2022-05-10 23:06:52
Subsystem: 07. [entry] Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2023-10-01 10:23:17
Resolution: None Closed By: nobody
    Closed on:
Description:
Is this behavior a bug?

$ rlwrap -pred tclsh
% package require Tk
8.6.9
% entry .e -width 30
.e
% pack .e
% 


Now type into the entry: aaa bbb ccc

select any of the 3 and do a copy
select any, say the bbb, and do a paste (control-v)

instead of replacing the selected bbb with the pasted contents, it inserts the text instead following the bbb and leaves it selected.

with a ttk::entry this does not happen, and on windows, the regular entry doesn't do this either. 

So.... a bug?
User Comments: fvogel added on 2023-10-01 10:23:17:

Well, the code corresponding to the paste action in an entry widget looks intentional. We could say this is to follow some platform-specific behavior (if it's the case?), but then what would be the justification for entry and ttk::entry to behave differently...? Indeed, ttk::entry intentionally deletes the selection before pasting.

See also [b8fcb26529].