Please let us know what module you are using. Tk, GTK+, Win32::GUI, something else? In Tk you can do this by creating a tag on your Text widget using the "bind" method, to call a particular subroutine on double-click, and use the getSelected method to obtain the current selection at that point.
my $mw = MainWindow->new;
my $txt = $mw->Text(-height => 5, -width => 40);
$txt->bind('<Double-Button-1>', sub { local $\ = "\n"; print $txt
+->getSelected});
$txt->pack;
| [reply] [d/l] |
An alternate interface that might be easier, have a place on your form where you paste in a block of text, select a dropdown and then hit a button to paste that text to the variable selected in your dropdown.
A nice thing about this approach is that all of the operations are going to be familiar to people who've never used your application. While "highlight this and click, then highlight that and click..." is going to be unusual enough to throw a lot of users. | [reply] |