f



Re: (fwd) manipulating a derived Tk::Text widget

On Feb 3, 2005, at 3:07 PM, Steve Lidie wrote:

> Hi,
>
> Yesterday a question was asked how to filter Control-g
> characters from printing.
>
> Well Marc Dashevsky had posted an earlier solution where
> he made a new text package like this:
>
> ####################################################33
> package Tk::MyText;
> require Tk::Text;
> use base qw/Tk::Text/;
> Construct Tk::Widget 'MyText';
>
> sub InsertKeypress {
>   my($w, $char) = @_;
>    if (ord($char) < 27) {
>      print chr(ord($char) | 0x40), "\n";
>      # only Control-G/J/L/M/Q/R/S/U/W/Y/Z are making it to here
>    } else {
>   $w->SUPER::InsertKeypress($char);
>   }
> }
> ######################################################
>
> Ok that works good.  But I noticed that if I add the line
>
> $mw->bind($class,'<Control-KeyPress>','NoOp');
> to the
> sub  bindRdOnly
> in Text.pm, it works well.
>
>
> So how do you make a package derived from Tk::Text,
> which does just one thing:
> add
> $mw->bind($class,'<Control-KeyPress>','NoOp');
> to the
>
> sub  bindRdOnly{}
>
> in Text.pm?
>
> Thanks.  I probably can figure this out by experimenting and
> hacking, but I figure there is a right way to do it. :-) I better ask.
>

It's all explained in MPTK - you override ClassInit() in the 
mega-widget to adjust your new class' bindings ;)

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu

0
Steve
2/3/2005 9:46:05 PM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

0 Replies
557 Views

Similar Articles

[PageSpeed] 33

Reply:

Similar Artilces:

manipulating a derived Tk::Text widget
Hi, Yesterday a question was asked how to filter Control-g characters from printing. Well Marc Dashevsky had posted an earlier solution where he made a new text package like this: ####################################################33 package Tk::MyText; require Tk::Text; use base qw/Tk::Text/; Construct Tk::Widget 'MyText'; sub InsertKeypress { my($w, $char) = @_; if (ord($char) < 27) { print chr(ord($char) | 0x40), "\n"; # only Control-G/J/L/M/Q/R/S/U/W/Y/Z are making it to here } else { $w->SUPER::InsertKeypress($char); ...

Re: Fwd: Perl/Tk ProgressBar widget
Graham Barr <gbarr@pobox.com> writes: >> >> Your name is listed in the "Author" section of the POD documentation >> that ActiveState ships with its release of Perl and the Perl/Tk >> modules, one of which is the ProgressBar widget.  If you are not >> responsible for the widget's implementation, please forgive this >> mis-directed email and, if you know of the proper recipient, please >> forward it there. As you note in your report ProgressBar has been hacked about since Graham was responsible for it. >>...

Re: (fwd) Re: Perl/Tk on Solaris 10
On Feb 7, 2005, at 9:35 PM, Steve Lidie wrote: > -- forwarded message -- > Path: > Lehigh.EDU!newsprint.newsread.com!newsread.com!news-xfer.newsread.com! > news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com! > local1.nntp.dca.giganews.com!nntp.bway.net!news.bway.net.POSTED!not- > for-mail > NNTP-Posting-Date: Sun, 06 Feb 2005 15:17:16 -0600 > Date: Sun, 06 Feb 2005 16:17:16 -0500 > From: "Mark E. Perkins" <nospam@example.com> > User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; > rv:1.7.5) Gecko/...

Re: (fwd) Re: Perl/Tk, fork and winNT
On Feb 6, 2004, at 9:18 AM, Steve Lidie wrote: > -- forwarded message -- > Path: > Lehigh.EDU!newsread.com!newsprint.newsread.com!newsfeed.media.kyoto- > u.ac.jp!newsfeed.gamma.ru!Gamma.RU!news.maxwell.syr.edu!elnk-pas-nf1! > newsfeed.earthlink.net!pd7cy1no!shaw.ca!pd7tw1no.POSTED!53ab2750!not- > for-mail > X-Trace-PostClient-IP: 24.85.70.6 > From: Jeff Hobbs <jeffh@activestate.com> > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) > Gecko/20040113 > X-Accept-Language: en-us, en > MIME-Version: 1.0 > Newsg...

Re: Tcl/Tk to Perl/TK Translation Problem
Philippe de Rochambeau <philippe@wwphi.net> wrote: > Hello, > > I am having problems translating the following tcl/tk code to perl/tk: > > ============ tcl code ============ > label .controls.sizel -text "Size:" > > grid .controls.quall .controls.quallo .controls.qual .controls.qualhi > -sticky ew > grid .controls.sizel .controls.sizesm .controls.size .controls.sizelg > -sticky ew > grid .controls.colorl .controls.color -sticky ew > grid configure .controls.color -columnspan 3 > grid configure .controls.quall .control...

compiling perl/tk widget (outside tk) on win32 ?
hi, i've got a problem, i have my external perl/tk widget, partially written in C it works well on linux when compiling, i'm using Tk::MMutil::TkExtMakefile to build make file; it somehow recognizes that i'm compiling the widget outside of Tk itself, at the end it produces Plotviewer.sl dynamic library when compiling on win32 (win xp, vc60), i get the same message when building makefile (that it recognized that i'm building the widget outside of Tk itself) but then it fails first problem is that it tries to create pTk.dll; not Plotviewer.dll; why ? second prob...

Re: (fwd) Re: (fwd) Tk::Tiler and Callbacks
On Thursday, Sep 11, 2003, at 10:00 US/Eastern, Steve Lidie wrote: > -- forwarded message -- > Path: > Lehigh.EDU!newsread.com!newsprint.newsread.com!news.maxwell.syr.edu!fee > d2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail > From: Michael Liebman <random74197@yahoo-DO-REI-ME.com> > Newsgroups: comp.lang.perl.tk > Subject: Re: (fwd) Tk::Tiler and Callbacks > Date: 11 Sep 2003 03:17:08 GMT > Lines: 31 > Message-ID: <Xns93F2ECDF95FB9random74197yahoocom@199.184.165.240> > References: <5E6DC918-E394-11D7-A0D3-003065C254B6@lehig...

Re: Proposed Modules: Tk::MDTextBook [renamed Tk::MIMEApp, Tk::Markdown, Tk::MarkdownTk
A set of modules that allow easy mixing of code types to be interpretted as a Tk application... The input is in MIME-multipart/mixed format, and easy entity can be markdown (displayed formatted in a Text with options to add Tk windows and behaviours), perl (eval()ed), yaml (structure made available to app) or menu in yaml (posted on main mindow). The purpose of this is to contribute to a compiled program (for Windows/Mac/Linux) that can run appended scripts in this format. The reason for having this format is that resources can be included in the one file. The Markdown s...

Re: (fwd) Re: (fwd) binding to a derived canvas widget
On Mar 31, 2006, at 3:55 PM, Steve Lidie wrote: > > >> From: Ch Lamprecht <christoph.lamprecht.no.spam@web.de> >> Newsgroups: comp.lang.perl.tk >> Subject: Re: (fwd) binding to a derived canvas widget >> Date: Fri, 31 Mar 2006 10:39:05 +0200 >> >> Hi, >> >> did you think of something like this? >> >> sub ClassInit >> { >> my ($class, $mw) = @_; >> $class->SUPER::ClassInit($mw); >> $mw->bind($class, "<1>" =>'pick_one' ); >> ...

Re: (fwd) Deriving from Tk::Photo
On Sunday, October 5, 2003, at 05:52 PM, Steve Lidie wrote: > -- forwarded message -- > Path: > Lehigh.EDU!att541!att542!ip.att.net!swen.emba.uvm.edu!news.cc.utah.edu! > xmission!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn- > xit-01!sn-xit-09!supernews.com!postnews1.google.com!not-for-mail > From: shrike@cyberspace.org (psyshrike) > Newsgroups: comp.lang.perl.tk > Subject: Deriving from Tk::Photo > Date: 5 Oct 2003 14:14:35 -0700 > Organization: http://groups.google.com > Lines: 39 > Message-ID: <79485f9d.0310051314.2e...

Re: What's new in Tk 8.4 for Perl/Tk
Revised: http://www.lehigh.edu/~sol0/ptk/whats-new.html -++**==--++**==--++**==--++**==--++**==--++**==--++**== This message was posted through the Stanford campus mailing list server. If you wish to unsubscribe from this mailing list, send the message body of "unsubscribe ptk" to majordomo@lists.stanford.edu ...

Re: (fwd) Re: (fwd) Panther and Tk-TableMatrix-1.01?
On Jan 6, 2004, at 8:33 AM, Steve Lidie wrote: > -- forwarded message -- > Path: > Lehigh.EDU!newsread.com!newsstand.newsread.com!kibo.news.demon.net! > demon!newsfeed.mathworks.com!wn11feed!worldnet.att.net!4.24.21.153! > chcgil2-snh1.gtei.net!news.bbnplanet.com!crtntx1-snh1.gtei.net! > news.gtei.net!newsfeed2.dallas1.level3.net!news.level3.com! > postnews1.google.com!not-for-mail > From: jerry.levan@eku.edu (Jerry) > Newsgroups: comp.lang.perl.tk > Subject: Re: (fwd) Panther and Tk-TableMatrix-1.01? > Date: 5 Jan 2004 21:20:30 -0800 >...

(fwd) Re: Features of latest Perl/Tk
On Jan 25, 2004, at 11:21 PM, Steve Lidie wrote: > -- forwarded message -- > Path: > Lehigh.EDU!newsread.com!newsprint.newsread.com!63.218.45.10.MISMATCH! > newshosting.com!news-xfer1.atl.newshosting.com!167.206.3.103.MISMATCH! > news3.optonline.net!pd7cy1no!shaw.ca!pd7tw3no.POSTED!53ab2750!not-for- > mail > X-Trace-PostClient-IP: 24.85.70.6 > Message-ID: <40149569.70205@activestate.com> > From: Jeff Hobbs <jeffh@activestate.com> > > Henry Merryweather wrote: >> As I almost exclusively use Mastering Perl Tk as a reference ...

Re: (fwd) Thoughts on namespaces in Perl/Tk
> > This post has to do with issues I've run into regarding namespace in > Perl/Tk. I am curious to see if others have run into the same issues, > and if so, how those issues were resolved. > > One thing that has been problematic for me in Perl/Tk is the use of > namespaces. When designing a new module there is nothing that says I > can't define any of the following packages: > > package Tk::MyWidget; > package Tk::MyApp::MyWidget; > package MyApp::MyWidget; > > The problem is that it's not really the package that's the ...

Web resources about - Re: (fwd) manipulating a derived Tk::Text widget - comp.lang.perl.tk

123D Tutorial: Manipulating components and incorporating design intent - YouTube
http://www.123Dapp.com/support - get the steps and model and do this tutorial yourself! Have few extra parts left over after putting your project ...

Indigenous land owners accuse lawyer of manipulating nuclear waste storage report
Lawyer who was key to Howard government's plan to store nuclear waste on indigenous land accused of manipulating legal process required to ensure ...


Doctor Mervyn Jacobson faces lengthy jail sentence after being found guilty of manipulating stock market ...
He has been praised by American presidents and British lords for his wildlife conservation efforts, and claims to have saved the brush-tailed ...

Facebook's Adam Kramer defends controversial emotion manipulating study
The creator of the controversial Facebook study now admits the findings "may not have justified all of this anxiety".

Australia accused of manipulating Australian dollar to save iron ore miners
... iron ore miners are so desperate for cash that ''even the kangaroos are for sale". An American iron ore miner says Australia is "manipulating" ...

Government accused of manipulating science news
The federal government engages in "unacceptable political interference" in the communication of government science, says the head of a group ...

Commentary: Japan's Abe manipulating a dangerous coup against pacifist Constitution
TOKYO,June30JapanesePrimeMinisterShinzoAbeismanipulatingadangerouscouptooverturnthecountry'spost-w

Over 50 US military analysts say Pentagon is manipulating Daesh reports
Over 50 US military analysts say Pentagon is manipulating Daesh reports

Volkswagen ordered to recall nearly 500,000 vehicles for manipulating software to circumvent emissions ...
Volkswagen has been manufacturing cars that only fully deploy their emissions control systems when they are undergoing fuel emissions inspection, ...

Resources last updated: 2/6/2016 1:48:10 PM