Sorry the command should have read

Um, thats not the only typo. No matter, here is some working code

#!/usr/bin/perl -- ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr +-ce -nibc -i=4 -pt=0 "-nsak=*" use strict; use warnings; use Data::Dump qw/ dd pp/; $Tkx::TRACE = 64; use Tkx; use Tkx::FindBar; my $name; my $mw = Tkx::widget->new( '.' ); my $text = $mw->new_text( -width => 20, -height => 10, ); foreach( qw/David Mary William/ ) { $text->insert( 'end', "$_\n" ); } my $findbar = $mw->new_tkx_FindBar( -textwidget => $text, ); $mw->g_bind( '<Control-f>' => [ \&Tkx::FindBar::show, $findbar ], +); $mw->g_bind( '<F3>' => [ \&Tkx::FindBar::next, $findbar ], +); $mw->g_bind( '<Shift-F3>' => [ \&Tkx::FindBar::previous, $findbar ], +); $mw->g_bind( '<Return>', \&fudge, ); $findbar->g_pack(); $text->g_pack(); $findbar->show(); Tkx::MainLoop(); sub fudge { dd( \@_ ); dd [ $text->m_tag_configure( 'highlight' ) ]; $name = $text->get( qw/highlight.first highlight.last/ ); print "The name is $name\n"; dd [ $text->tag( qw' ranges highlight' ) ]; $text->m_tag_add( 'sel', qw/highlight.first highlight.last/ ); $text->g_focus; ## g_focus is g_focus not m_focus $findbar->hide; } ## end sub fudge

In reply to Re^10: Getting selection from Tkx text (typos) by Anonymous Monk
in thread Getting selection from Tkx text by dabella12

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.