> 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.

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 maintains
selection) 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 !focus
selected 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.


> 
> 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?


> 
> 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?

> 
> 
> 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.

Best regards,
Vadim.

Reply via email to