f



Tk::Text, is there a selection?

Hi,

from the documentation to Tk::Text i concluded that i can get
the selection by:

$txt->get('sel.first', 'sel.last');

But i need to test if there IS a selection.  To do this i
should test if the option "exportSelection" is true.

How do i do that?  I tried:

$t->cget('exportSelection')

But that was always true.  How do i test for the selection?


Best regards,
Torsten.

0
Torsten
9/6/2004 9:32:20 PM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

4 Replies
404 Views

Similar Articles

[PageSpeed] 35

In article <chil14$bpn$1@schleim.qwe.de>, tmohr@s.netic.de says...
> Hi,
> 
> from the documentation to Tk::Text i concluded that i can get
> the selection by:
> 
> $txt->get('sel.first', 'sel.last');

Or via $txt->getSelected;

> But i need to test if there IS a selection.  To do this i
> should test if the option "exportSelection" is true.
> 
> How do i do that?

What's wrong with:

	print "Nothing selected\n" unless $t->getSelected;

-- 
  Go to http://MarcDashevsky.com to send me e-mail.
0
Marc
9/6/2004 10:11:28 PM
Hi,

> Or via $txt->getSelected;

that works, thanks!

> What's wrong with:
> 
> print "Nothing selected\n" unless $t->getSelected;

I do not find any reference to "getSelected" in Tk::Text,
even now that i know it exists.  Else i think i would have
used it.


Thanks,
Torsten.

0
Torsten
9/8/2004 6:26:53 PM
In article <chnitd$a5l$1@schleim.qwe.de>, tmohr@s.netic.de says...
> Hi,
> 
> > Or via $txt->getSelected;
> 
> that works, thanks!
> 
> > What's wrong with:
> > 
> > print "Nothing selected\n" unless $t->getSelected;
> 
> I do not find any reference to "getSelected" in Tk::Text,
> even now that i know it exists.  Else i think i would have
> used it.

I'm running perl/Tk 804.027 and the getSelected method is documented,
so perhaps the pod has been improved.

-- 
  Go to http://MarcDashevsky.com to send me e-mail.
0
Marc
9/8/2004 8:07:59 PM
"Marc Dashevsky" <usenet@MarcDashevsky.com> wrote in message
news:MPG.1ba930a77a3566c0989a45@netnews.comcast.net...
> In article <chnitd$a5l$1@schleim.qwe.de>, tmohr@s.netic.de says...
> > I do not find any reference to "getSelected" in Tk::Text,
> > even now that i know it exists.  Else i think i would have
> > used it.
>
> I'm running perl/Tk 804.027 and the getSelected method is documented,
> so perhaps the pod has been improved.

Yes. I did that for 804; with the permission of O'Reilly publishing and
Steve of course ;)

As wonderful as Mastering Perl/Tk is - I got tired of having to always look
them up. Surprisingly, the book binding has held up rather well around p.189

Jack


0
Jack
9/9/2004 12:24:39 AM
Reply:

Similar Artilces:

Perl/Tk: 'selection conversion left too many bytes unconverted' error on large text selection
Hi all, I've written about this before, but it's come back and I still haven't found what the problem is. Basically, in Perl/Tk if a textbox has a lot of text in it (no idea on the limit yet - all I know is that it has to be a _lot_ of text), and all the text is selected (and therefore copied to the clipboard) the entire perl process is halted, the gui disappears and the error: selection conversion left too many bytes unconverted appears on the command line. This appears to be a tcl panic error (hence the cross-post to comp.lang.tcl as I'm not sure where the problem i...

Solution [ Perl/Tk: 'selection conversion left too many bytes unconverted' error on large text selection ]
After I got bitten enough by this error and found no solution on the web I had to debug it myself. For me it looks like the following: - text get selected from Tk::Text - TkSelPropProc in ./pTk/mTk/unix/tkUnixSelect.c gets called to handle the selection which determines that the display supports utf-8 and thus gets Encoding::utf8 as the responsable encoder (see Encode::Encoding for the interface) - then it calls Tcl_UtfToExternal to convert the selection from internal format to utf8, this function is defined in encGlue.c and just calls CallEncode in the same fil...

Linux Perl-TK -> Win32 Perl-Tk
I've got an app that I wrote in Perl-Tk for Linux (Redhat) that I would like to run on my Win32 laptop. I am not interested in dual-booting this laptop but would like to get the app up an running. I'm a perl-Tk hack at best. What is the best/easiest way to port the application? thanks, Mike On Tue, 21 Dec 2004 03:01:21 +0000, Michael Seningen wrote: > I've got an app that I wrote in Perl-Tk for Linux (Redhat) that I would > like to run on my Win32 laptop. > > I am not interested in dual-booting this laptop but would like to get > the ap...

Perl/Tk and Tk 8.5
Is there any word on when the enhancements in Tk 8.5 (Tiles, themes, better-looking widgets) will be made available in the Perl/Tk port? I know that ActiveState has made some of this available for awhile in the "Tkx" module, but I'm interested in cross-platform support and am wondering when 8.5 will be incorporated in the base "Tk" port module. [Cross-posted to comp.lang.perl.tk with follow-ups set to go there.] Steve wrote: > Is there any word on when the enhancements in Tk 8.5 (Tiles, themes, > better-looking widgets) will be made available in the P...

Bug in perl tk (Tk::Tree) ?
Hello, This simple script below... ------------------------------------------------------------ #!/usr/bin/perl -w use strict; use warnings; use Tk; use Tk::widgets qw/Tree ItemStyle/; my $mw = MainWindow->new(); $mw->fontCreate("MyFont", -family=> 'helvetica', -size => 9, -weight=>'medium'); my $t = $mw->Tree()->pack(); $t->ItemStyle('imagetext', -stylename => 'foobar', -activeforeground => '#ff0080', -font => 'MyFont', ); $t->add('root', -style => &...

switching Tk::Text / Tk::ROText
Hi, thinking about Frank Kulows last posting, I was looking for a way to switch a Text widget from Text to ROText and backwards. Here is where I ended: It's still not really satisfactory, because both classes have to be initialized first (either by calling 'ClassInit' manually or by creating a 'dummy' instance). Also rebuilding the menu does not look very elegant. This is partial due to the way Tk::ROText changes the default 'Search' menu, deleting the 'Replace' entry after initialization instead of providing a Tk::ROText::SearchMenuItems metho...

perl -e "use Tk" failed after installing perl tk
Now I want to debug perl script through ptkdb under Windows XP. I installed perl tk 804.028 using the below command first because ptkdb depends on perl tk. ppm install Tk But some errors pop out when the command(perl -e "use Tk") exec after installing perl tk, " Can't locate Tk.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/ lib .) at -e line 1. BEGIN failed--compilation aborted at -e line 1. " ActivePerl: Build 1004 Perl: 5.10.0 On 19 mai, 15:30, Erik <zhengfen...@gmail.com> wrote: > Now I want to debug perl script thro...

perl tk equivilent to Tcl/Tk fitToContents
Is there a perlTk equivilent to the TclTk fitToContents command you can run on a window. By default it seems that it automatically dits to contents for me, until a user does a manual resize, then it stops... Randell Pelak wrote: > Is there a perlTk equivilent to the TclTk fitToContents command you > can run on a window. By default it seems that it automatically dits > to contents for me, until a user does a manual resize, then it stops... So once the user sets the window the way they want, you're going to change it? Not very user friendly. You could just make the ...

Perl/Tk Novice....Tk Error ...Help!
Hi, Does anynody know and understand the following Tk error - Possible precedence problem on bitwise ^ operator at .../blib/lib/Tk/Scale.pm (autosplit into .../blib/lib/auto/Tk/Scale/Increment.al) line 242. I'm trying to get a scale value when I click on the slider. Are there any simple examples of all the pre-ambles required to set up a slider on a canvas and capture the input from the user ? Any pointers would behighly appreciated. Thanks much in advance, Nash nrg@ornl.gov ...

Tcl/Tk to Perl/TK Translation Problem
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 .controls.sizel .controls.colorl -sticky e grid configure .controls.quallo .controls.sizesm -sticky e grid configure .controls.qualh...

Porting tk extensions to perl/tk how-to guide
We have a few tk extensions involving direct xlib calls. Is there any cookbook approach to converting these extensions to perl/tk extensions, or any general description of the process? ...

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

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

Tk::send & Tk::Receive
Hi all, One of my apps sends tcl/tk script bits to our mail client (ExMH) so it can make ExMH pop up message composition windows. I need to write a small helper stub that does the same, but that doesn't itself have a GUI. It also needs to be as small as possible (memory footprint wise). Does anyone know a way to send data to active Tcl programs like Tk::send but without perl/Tk? TIA, MB On Fri, 21 Jul 2006 15:34:45 +1000, Matthew Braid <not@invalid.invalid> wrote: >Hi all, > >One of my apps sends tcl/tk script bits to our mail client (ExMH) so it...

Web resources about - Tk::Text, is there a selection? - comp.lang.perl.tk

Selection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Cooper misses selection for Sydney Sevens
Wallaby five-eighth misses selection for the Sydney Sevens after being omitted from the squad.

Dumped Maroons still eligible for Australian Kangaroos selection
Their State of Origin hopes may have been dashed but the banned Queenslander's could still represent the Kangaroos this season.

Murder trial in death of Tim Bosma starts Monday with jury selection
... took two men for a test drive in his truck never to return. The trial of two men accused in his death is set to begin Monday with jury selection, ...

Lloyd Carr Among 4 Named to College Football Playoff Selection Committee - Bleacher Report
Four new members were appointed to the College Football Playoff selection committee Thursday, including former University of Michigan head coach ...

Selection of Awesome Russian Jets from 2015
Russian photographer and a blogger, Mike S., decided to post his best shots of the previous year and it came out to be pretty brilliant collection. ...

Jury Selection Starts in Prison Contraband Drone Case
Jury selection is underway for the trial of a Maryland man accused of planning to use a drone to fly drugs, tobacco and pornography into a maximum-security ...

Lloyd Carr, Rob Mullens, Jeff Bower, Herb Deromedi named to College Football Playoff selection committee ...
Former Michigan coach Lloyd Carr, Oregon AD Rob Mullens, ex-Southern Miss coach Jeff Bower and former Central Michigan coach Herb Deromedi will ...

2016 Pro Bowl Roster & Teams: Full Draft Selections
Who is playing in the Pro Bowl and for which team?

How Genetic Selection Could Affect The Future Of Pregnancy
Alec Ross, author of The Industries of the Future , spoke with HuffPost Live on Monday about the future of genetic selection. This feed and ...

Resources last updated: 2/6/2016 7:19:20 PM