| Ticket UUID: | 981545 | |||
| Title: | better -exportselection behavior | |||
| Type: | Patch | Version: | None | |
| Submitter: | hobbs | Created on: | 2004-06-28 20:43:40 | |
| Subsystem: | bwidget | Assigned To: | damonc | |
| Priority: | 5 Medium | Severity: | ||
| Status: | Closed | Last Modified: | 2009-07-14 16:32:46 | |
| Resolution: | Accepted | Closed By: | oehhar | |
| Closed on: | 2009-06-11 09:18:43 | |||
| Description: |
The following patch was sent to me as a recommendation
for better behavior on unix. It looks OK to me, but
someone should double-check that it doesn't look too
funky on unix (where is has more noticeable effect):
I tried to turn off the -exportselection option for the
ComboBox. The result was the entry text was still
selected, but now it did not deselect even if other
places in the app grabbed the selection. There appear
to be now way to get rid of the selection after this.
The following patch to ActiveTcl fixes this problem.
--- lib/bwidget1.7/combobox.tcl.dist2004-05-26
09:23:49.000000000 +0200
+++ lib/bwidget1.7/combobox.tcl2004-05-26
09:34:08.000000000 +0200
@@ -599,7 +599,9 @@
}
}
$path.e selection clear
- $path.e selection range 0 end
+ if {[$path.e cget -exportselection]} {
+ $path.e selection range 0 end
+ }
}
| |||
| User Comments: |
oehhar added on 2009-07-14 16:32:46:
Thanky to Eric, I have got the point.
One requires values to test it.
Revised test script:
-----
pack [ComboBox .c -values {1 2 3}]
pack [ComboBox .n -exportselection 0 -values {1 2 3}]
-----
When clicking on an item in the drop-down box, the result gets selected in the first case. In the second, it does not and the cursor is placed behind the entry.
A matter of taste. Please post, if you like it or not.
oehhar added on 2009-07-08 00:29:21: Erik Leunissen reported, that the patch is useful for him. So I activated it in cvs. oehhar added on 2009-06-11 16:18:43: The patch seams reasonable to me too. Nevertheless, I have checked the behaviour on windows and linux with and without patch. It works fine for both cases. #- test script - pack [ComboBock .c] pack[ComboBox .n -exportselection 0] # set a selection in both using the mouse .c configure -exportselection 0 In the first case, the selection is exported and removed if there is somewhere else a selection In the second case, the selection is local and not exported to other windows. I decided not to apply the patch. Please notify, if the patch helps anybody, no issue to put it in neither. jenglish added on 2007-10-22 12:08:38: Logged In: YES user_id=68433 Originator: NO Not my department. Damon? FWIW: On X11, Gtk+ and Qt editable comboboxes do export the selection; ditto spinboxes and entry fields. The only major toolkit I've encountered that doesn't do this is the one Mozilla-family tools use; there, entry fields appear to use a hybrid X11-style global primary selection combined with Windows-style independent selection (which I personally find very confusing.) eriklns added on 2007-01-07 05:47:38: Logged In: YES user_id=113903 Originator: NO Personally, I do not find this too funky at all. In fact, I'm inclined to go one step further and change the default for this option (-exportselection) into 0. The documentation for this option says: "The default is usually for widgets to export selections." (meaning the X-selection) I question this statement. I haven't seen many applications that show this default behaviour. (Maybe it is a Unix tradition.) A combobox is primarily about selecting an item from a collection of items. This is unrelated to selecting a sequence of characters for a copy/paste operation, and we ought not confuse/mix these two different concepts. If users do want to set the X-selection too, they may choose to change the default. | |||
Home
Blog
Docs
Downloads
Tickets
Timeline
Branches
Tags
Wiki