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

Solved:
use strict; use Prima qw( Application VB::VBLoader); my $ret = Prima::VBLoad('H:\My Documents\PERL\Prima\Concepts.fm', Populate => {onClick => sub{trythis("writing ...")}}, ); die "$@\n" unless $ret; sub trythis { my ($x) = @_; $ret-> textbox-> set(text => $x); } our $global = $ret-> textbox-> text; print "$global\n"; $ret-> execute;
Just needed to do some trial and error testing and it came out.

Replies are listed 'Best First'.
Re: novice Prima question
by jdporter (Paladin) on Oct 22, 2007 at 16:29 UTC

    The OP violated one of our cardinal rules and completely replaced the contents of his post. Here is the original content, as horked from a search engine cache:


    Hi
    This is my first day with Prima and I'd like some help with a understanding of two concepts that have me baffled at the moment.

    Question 1. How do I get a click of the button to enter text (say, the word 'Help') in to the textbox? I've tried various lines in the onclick method but all failed.

    Question 2. How could I get the textbox contents associated with the global variable $capture?

    Perl Script
    use strict; use Prima qw( Application VB::VBLoader); my $ret = Prima::VBLoad('H:\My Documents\PERL\Prima\Concepts.fm'); die "$@\n" unless $ret; use vars qw(@ISA); @ISA = qw(Prima::MainWindow); $ret-> execute; our $capture;
    Form
    # VBForm version file=1.2 builder=0.2 # [preload] sub { return ( 'textbox' => { class => 'Prima::InputLine', module => 'Prima::InputLine', profile => { owner => 'Concepts', text => '', name => 'textbox', origin => [ 92, 72], size => [ 96, 17], }}, 'Concepts' => { class => 'Prima::Window', module => 'Prima::Classes', parent => 1, code => Prima::VB::VBLoader::GO_SUB(''), profile => { width => 386, left => 530, name => 'Concepts', origin => [ 530, 299], height => 177, bottom => 299, size => [ 386, 177], sizeDontCare => 0, originDontCare => 0, }}, 'Populate' => { class => 'Prima::Button', module => 'Prima::Buttons', profile => { owner => 'Concepts', text => 'Add to textbox', name => 'Populate', origin => [ 236, 60], size => [ 96, 36], onClick => Prima::VB::VBLoader::GO_SUB('my $self = $_[0 +];','Populate', 'onClick'), }}, ); }

    Any help much appreciated.

    Brian Rowlands