On Mon, 25 Dec 2023 02:43:26 -0000 (UTC), Rich wrote:
I find this difficult.
It is not so difficult, but one does have to "poke around":
**************************
Many thanks for your help again. It was fascinating to see how you
inspect the innards of the machine. I'm just sorry I couldn't figure it
out by myself. I feel stupid. But I'm always grateful for the education.
As I like to say, Tcl is easy but I don't always understand Tk. It all
looks like a big entanglement of strings to me. Each one can move many
other strings which in turn move their on.
Your guidance seems to have pointed me in the right direction. But I
still can only go so far.
I bound Ctrl-Left and Ctrl-Right to swtching tabs. It works except that Ctrl-Left makes the selections go up one line at every key press.
Only Ctrl-Left. So I put your teachings into practice:
bindtags $::Widgets_unipane.fileListPane.filenameframe.box
foreach b [bind Text] {puts $b}
and here it is, I'm sure these are the culprits:
<Control-Key-Next>
<Control-Key-Prior>
puts [bind Text <Control-Prior>]
%W xview scroll -1 page
puts [bind Text <Control-Next>]
%W xview scroll 1 page
I gotta say, I kind of resent these default bindings. They get in the
way often. I think we should have more "pure" or "agnostic" widgets.
Anyway, I'm stumped again. How do I kill those? I googled and found
people with more or less similar problems, but never a satisfactory
answer.
For example:
"Removing a binding from one bindtag does not mean that the event will
not be processed; a binding on another bindtag might still pick it up.
Trying to hack around the other bindtags to fool the code is not going
to be satisfactory. However, if a binding on one tag finishes with a
break, it prevents further bindtags from being tried; it terminates
processing early."
That sounds terse.
1. Is it doable or not? I don't think that is answered clearly.
2. I am using break. But that is obviously not preventing the hard coded
[bind Text <Control-Prior>] from kicking in.
3. Even more confusing is the fact that [bind Text <Control-Prior>] is
causing the "ghost" movement, but [bind Text <Control-Next>] is not.
Why is that?
There are 500 lines in that text widget and the selection/insert mark is
near the top. It would make sense if it didn't move up and did move down
since there are literally hundreds of lines worth of scrolling below the selection/insert mark but no room for the widget to scroll up.
And they're both interfering with the same one proc.
if {$action == "next"} {
just "forget" one tab and pack another,
nothing to do with moving the selection
}
if {$action == "previous"} {
just "forget" one tab and pack another,
nothing to do with moving the selection
}
Why do they behave differently?
I know you want to see code and all of this will be published eventually,
but I'm at 1,000 lines of code here and I can't really isolate
particularly small parts. I just hope you can have a clue out of what
I'm telling you so far. Can you?
--
Luc
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)