Re: Re: Tcl/Tk 8.4.12 for WinCE ARM binaries availa ble

Johannes Hausmann <[email protected]> Thu, 12 Jan 2006 15:21:44 +0100
Newsgroups gmane.comp.windows.ce.freeware
Message-ID <[email protected]>
Konovalov, Vadim wrote:

>>>I also noticed that the same is true for buttons in general, 
>>>i.e., you can't keep them pressed.
>>>
>>>But for scrollbars, the arrow buttons do work in this way.
>>>      
>>>
>>In giving a poke at the behavior, I found that we are getting
>>Enter and Leave events triggered.  Use tkcon and this simple
>>script:
>>
>>package require Tk
>>pack [button .b -text Hello -command {puts hello}]
>>bind .b <Enter> {puts enter}
>>bind .b <Leave> {puts leave}
>>raise .
>>
>>and select .b and you will see a leave happening, which is
>>what causes the relief to return to normal, and what likely
>>prevents the repeat delay.  Interestingly, click and hold
>>over the button, wiggling the mouse slightly - you will see
>>repeat enter/leave and the relief changes, but only upon
>>final release does the command trigger (at least that part
>>is the expected behavior ...).
>>
>>I have not noticed this until you brought it up, so I can't
>>say specifically what the issue is (haven't had the time to
>>delve into C yet).
>>    
>>

Agreed, there are <Leave> events that produce the anomalous behavior. I 
found a solution (in the C code), too - but I'm pretty sure it's not the 
right way to do it. Anyway, here's what I did:

In generic/tkPointer.c, function Tk_UpdatePointer(tkwin, x, y, state) in 
line 267, there's a call to GenerateEnterLeave(...). If you comment that 
out, e.g. #if !defined(UNDER_CE) ...GenerateEnterLeave... #endif, the 
button command works correctly, including autorepeat.

Unluckily, this does not solve the problem with the spinbox buttons for 
which I haven't found a solution.

>Isn't this just OS triggering right-click, wo when user taps and holds, then
>right-click menu appears?
>  
>

Hm. Could you elaborate on that? This sounds to me as a possible 
explanation for another glitch I've notice, namely, selection by tapping 
and dragging the stylus in a text widget makes the selection jump about 
rather wildly from the current position to either the beginning or end 
of the text.

>BTW which source was used for diff files within tcltk8_4_12_ce-arm archive?
>Those do not cleanly apply to 8.4.12
>  
>
The code patches okay vs. tcl/tk 8.4.12 sources but the configure and 
tcl.m4 are rejected. I simply took those from the 8.5a3 sources and 
slightly adapted them. Then there are only minor fixes u need to 
compile. If you're interested, I can send patches - but they're pretty 
huge, around  1.2 MB zipped, and I don't quite understand why (maybe 
Windows 0xOd/Ox0A vs Unix 0x0A?)...

Thanx for your help,

Joe