[This is a Usenet newsgroup, you just happen to be using google groups
to read/post to it. In which case, please follow Usenet conventions in
properly quoting context from the article to which you are replying.
Those of us who avoid google groups like the plague (it is an awful way
to read Usenet newgroups) end up with a new article with zero context
of what was in the article to which you replied.]
Frank <
kra...@gmail.com> wrote:
> You got me looking more in detail to the TkCon code. :-)
> If I execute the following code:
> if { ![catch {package present tkcon} } { ::tkcon::Prompt }
> The prompt is redisplayed at the end/bottom of the tkCon console.
>
> The question is now, how could I automate this so when idle (no procs
> running) the prompt will be added.
The easiest would be to just create for yourself a wrapper proc for
interacting with TkCon window, and call tkcon::Prompt as the last thing
you do in the wrapper. I.e.:
proc write-console {string} {
.tkcon.text insert end $string ;# Note - I don't know how you are
# actually 'stuffing' data into the
# text widget, so I've made something
# up here.
other-stuff-you-do-with-the-console
::tkcon::Prompt
}
This would give you a prompt after every "write-console" call,
automatically.
If you only want a prompt after some writes, but not others, then
create two wrappers, and always remember to call the 'prompting'
wrapper at the points where you really do want a prompt to appear.
> Currently I am looking into using a bind so when the focus or mouse
> enters widget it will be invoked but I am looking for a more elegant
> solution.
Seems overkill, unless you only want the prompt to appear when a user
focuses into the console. But if the user never focuses out and back
in, this binding would not fire, and no prompt would appear.