Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Ignore keystrokes in Tk

Reply
Thread Tools

Ignore keystrokes in Tk

 
 
Larry
Guest
Posts: n/a
 
      12-12-2005
Another Tk question ... I have a textbox that I want to populate from
my script, and I want the user to be able to select and copy from the
textbox, but I don't want them to be able to modify it. There is a
"-state disabled" attribute which prevents them from modifying, but it
also prevents them from selecting text.

I'm thinking I need to do something with "bind" but I can't figure out
what. I tried binding the <Key> event to a subroutine that returns 0,
or returns 1, and neither had any effect.

 
Reply With Quote
 
 
 
 
Eric Bohlman
Guest
Posts: n/a
 
      12-12-2005
"Larry" <(E-Mail Removed)> wrote in news:1134411759.156788.317960
@f14g2000cwb.googlegroups.com:

> Another Tk question ... I have a textbox that I want to populate from
> my script, and I want the user to be able to select and copy from the
> textbox, but I don't want them to be able to modify it. There is a
> "-state disabled" attribute which prevents them from modifying, but it
> also prevents them from selecting text.


By a "textbox" do you mean an Entry or a Text? If the latter, there's
already an ROText that will do what you want.
 
Reply With Quote
 
 
 
 
Larry
Guest
Posts: n/a
 
      12-13-2005
Eric Bohlman wrote:
> "Larry" <(E-Mail Removed)> wrote in news:1134411759.156788.317960
> @f14g2000cwb.googlegroups.com:
>
> > Another Tk question ... I have a textbox that I want to populate from
> > my script, and I want the user to be able to select and copy from the
> > textbox, but I don't want them to be able to modify it. There is a
> > "-state disabled" attribute which prevents them from modifying, but it
> > also prevents them from selecting text.

>
> By a "textbox" do you mean an Entry or a Text? If the latter, there's
> already an ROText that will do what you want.


It's actually a "Scrolled".

 
Reply With Quote
 
Larry
Guest
Posts: n/a
 
      12-13-2005
Larry wrote:
> Eric Bohlman wrote:
> > "Larry" <(E-Mail Removed)> wrote in news:1134411759.156788.317960
> > @f14g2000cwb.googlegroups.com:
> >
> > > Another Tk question ... I have a textbox that I want to populate from
> > > my script, and I want the user to be able to select and copy from the
> > > textbox, but I don't want them to be able to modify it. There is a
> > > "-state disabled" attribute which prevents them from modifying, but it
> > > also prevents them from selecting text.

> >
> > By a "textbox" do you mean an Entry or a Text? If the latter, there's
> > already an ROText that will do what you want.

>
> It's actually a "Scrolled".


Oh, I get it... I didn't realize that the Scrolled had "Text" as an
option. I changed it to "ROText" and that did the trick. (Except that
it also made the background gray, but I was able to fix that with
"-background white").

Thanks!

 
Reply With Quote
 
Eric Bohlman
Guest
Posts: n/a
 
      12-14-2005
"Larry" <(E-Mail Removed)> wrote in
news:(E-Mail Removed) oups.com:

> Oh, I get it... I didn't realize that the Scrolled had "Text" as an
> option. I changed it to "ROText" and that did the trick. (Except
> that it also made the background gray, but I was able to fix that with
> "-background white").


It's not an "option"; it's a "subwidget" (Scrolled is actually a composite
widget consisting of a user-specified subwidget and two scrollbar
subwidgets).

> Thanks!


And thanks for reminding me about the background issue; I had forgotten
about it and was wondering why the ROText I'm using in a quote-collection-
viewer looked so off.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rommon mode won't respond to keystrokes bw0507@gmail.com Cisco 4 02-05-2006 02:57 PM
Send Keystrokes to Client Side Application Lucas Tam ASP .Net 5 12-02-2004 07:19 PM
Capturing Keystrokes Rob T ASP .Net 1 05-14-2004 11:52 AM
Ignore + TEST + Ignore SpooderStank Computer Support 2 04-08-2004 11:26 AM
Searching for Exact Phrase - should I ignore the ignore words? Rob Meade ASP General 6 03-01-2004 11:28 AM



Advertisments