http://www.perlmonks.org?node_id=819014

bobuillean has asked for the wisdom of the Perl Monks concerning the following question:

Folks,

I have a Padre plugin under construction that needs to get some user input. Is it as easy as:
use Wx::Perl::Dialog::Simple; my $response = entry( 'title' => "What's yer poison");

?

If so why wouldn't this work?

sub menu_plugins_simple { my ($self) = @_; return $self->plugin_name() => [ 'Add' => sub { my $name = entry(title => "Cad an sceal?"); }, ]; }

The menu comes up OK in the Plugins menu but the 'Add' option does nothing.

Thanks in advance for any tips.

Replies are listed 'Best First'.
Re: Padre User Interaction in plugin
by Corion (Pope) on Jan 22, 2010 at 12:32 UTC

    How does it fail for you?

      Wow - quick response! Thanks.

      Literally does nothing. I select the 'Add' option & nothing happens.

      But I have figured something out - I have to qualify 'entry' with the package name (i.e. qw (entry) doesn't work). Works as expected after that.

      Could be because I haven't restarted my laptop since I installed Padre this morning.

      I'll check this out later.

      It's nice to be back inside the gates - I haven't looked in for a good while. I'm sure I'll have some more idiot moments before too long.

      Thanks again