Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Text widget focus problem

13 views
Skip to first unread message

S-Y. Chen

unread,
Dec 23, 2009, 10:46:51 AM12/23/09
to
Dear All,

I am having this focus problem on text widget, and wondering if anyone
can help. It is different with the one mentioned by someone before

I force tcl shell to load tk dll, and read in a script to create menu,
text, etc when it started. I can not type in anything in the widget,
unless I do one of the following


1. Click on the command console, and click back on the text widget.
Or
2. Load something into the text widget.

I suppose that is because my initial text is actually empty ? Or
something else ?

Any help will be greatly appreciated.

Regards
S-Y. Chen

Arjen Markus

unread,
Dec 23, 2009, 10:55:06 AM12/23/09
to

Do you have a small script that reproduces this problem?

Regards,

Arjen

S-Y. Chen

unread,
Dec 23, 2009, 11:08:21 PM12/23/09
to
I was unable to reproduce the problem with a small script. My version
of Tcl/Tk is heavily modified in the C source code level and it is too
difficult for me to reproduce it with a small script.


However I was able to pin-point the problem. It seems to be the
"tk_chooseDirectory" command causing the problem.

Here is what I have obverved

1. If I do not invoke this command in my initialization script, I can
type into text widget directly.
2. If I invoke this command twice in my initialization script, I can
type into text widget directly too.
3. Typing "tk_chooseDirectory" did not cause the problem. Because as I
have said, once I have focus on the command console (even without
doing anything), I can type in my text widget again.


I don't know if this helps. I am still trying to find out a solution.


Regards
S-Y. Chen

Eric Hassold

unread,
Dec 24, 2009, 6:09:33 AM12/24/09
to
Hello,

Since you are loading Tk into a tclsh shell, this looks similar to issue
discussed here:

http://groups.google.fr/group/comp.lang.tcl/browse_thread/thread/80010819b7e94a29/86b800ebe9622b7c

and its related ticket:

https://sourceforge.net/tracker/?func=detail&aid=2001072&group_id=12997&atid=112997

Eric

S-Y. Chen

unread,
Dec 24, 2009, 12:29:29 PM12/24/09
to
Yes. I was able to type in text widget, after I add

tkwait visibility .

before the

tk_chooseDirectory

Thanks a lot !

Regards
S-Y. Chen

0 new messages