Hello Vadim, thanks for the reply.On 21.7.2006, at 19:13, Konovalov, Vadim Vladimirovich (Vadim)** CTR ** wrote:
It is ROText problem. Selection works but is invisible on Windows and Mac, but it is perfectly visible on Linux.I have found very strange behavior of ROText in Tcl::Tk. 1. Selection (tag 'sel') works halfway and differently on each platform: It only work via mouse (not via arrow keys) and it is visible only on Linux. On Mac and Windows, selection is there, but invisible.If I understand the situation correctly, this is a problem with Text widget rather than particular ROText.
In Text selection shows normaly on all platforms.
I asked in ActiveTCL list: http://aspn.activestate.com/ASPN/Mail/ Message/activetcl/3172029 (but I do not see replies, neither Jeff's, nor my reply to his reply -- strange)On windows, "Text" selection is hidden when widget loses focus, and this is frustrating: even when I use scrollbars to scroll the text, selection disappears.This is how Jeff explained to me: ==quote=== Yes, this is something that is platform dependent (only X11 maintainsselection) and is actually hard-coded in at the C level. I would favor changing this, but it is also something that is more theme-driven. The newer themed widgets have a sense of state, which allows for focus and ! focusselected colors. ==end-of-quote===As I currently see, Linux behaviour is better WRT this, but Windows behaviour is just needs to be fixed.Very same behaviour within perl/Tk.I was hoping "Tile" package will provide "Text" with configurable themed selection, but I am out of luck.
This is IMHO something completely different.I am talking about ROText, that shows selection on Linux (which I don't understand; I know it is supposed to be 'disabled'). I would expect selection not to work at all, but it does work even on Mac and Windows, only it is invisible. Even if it is not visible, the 'sel' tag exists, when I click and drag with the mouse in ROText.
Buttons I have made in my applications and that call the same function as the aforementioned binding on ROText widget. They basically just create colorful tags from selection in the ROText widget.2. Key bindings (e.g. $t->bind( "<Key-j>", \&TagAsPerson );) do not work (respective tagging functions work fine via buttons).which "buttons" do you mean?
I am suspicious, possible that binding is ignored due to "- state=>disabled" option?
Probably. But why do those things start working in certain situations?When it happens, Text does not become "enabled" Input and deletion still do not work.
3. On Windows both 1. and 2. are true when I load my Tcl::Tk application alone. However as soon as I load any Perl::Tk or Tkx application (it does not have to contain an ROText widget) when Tcl::Tk one is running,Tcl::Tk ROText starts behaving differently (better for me, actually!):-- selection becomes visible-- most key bindings start working -- cursor (still invisible) can be placed via mouse click -- selection via arrows works, but only horizontally. Vertical arrows do nothing.Just now I have found this modification also happens when I have no selection and try to create a tag. I get Tcl error and then it works as described above, no other application loading necessary.Do you have example of code handy, to demostrate the behaviour?
Yes, I will send you of my application to your mail (not to the list).I have now found what is the problem with "up" and "down" arrows. They *do* work, but they do not respect soft wrap. When there is no "\n" in the text, it is seen as one line. Not a bug, but very inconvenient for editing of soft wrapped text. I find behavoir of Perl::Tk Text (and common word processors) much more convenient in this aspect.
Why is this happening? and more importantly: How can I make Tcl::Tk ROText behave this way by default on all systems without the strange magic? I need sellection, cursor and (all) key bindings working consistently everywhere.Speaking on difference between perl/Tk ROText and Tcl::Tk ROText, they are implemented differently: set of predefined bindings in perl/Tk, and "-state=>'disabled' in Tcl::Tk's case. We can reimplement ROText for Tcl::Tk, if this will actually cure the situation...Speaking about selection.As long as Tcl::Tk ROText is nothing more but Text with - state=>'disabled', plus 2 overridden methods, then things with consistent selection will not be fixed until Tk's problem.
Yes, I have seen both implementations. I konw, the current Tcl::Tk ROText is just a disabled Text. I want something that would work like Perl::Tk ROText, but I can't implement it. I have no idea, what happens on Windows in the situation I have described, but the result is *almost* what I need:
-- key bindings work -- selection is visible -- arrow keys work what is still missing: -- visible cursor -- "up" and "down" arrow keys moving on soft wrapped text lines.If you would reimplement the ROText to match the Perl::Tk one, it would be really great.
Pavel
smime.p7s
Description: S/MIME cryptographic signature