Re: Complete example

From: Dmitry Karasik <dmitry_at_karasik.eu.org>
Date: 28 Aug 2004 18:39:57 +0200
To: prima_at_prima.eu.org

        Hi Jason!

On 28 Aug 04 at 00:36, "Jason" (Jason Taylor) wrote:

 Jason> Does anyone have a complete script example they're willing to share
 Jason> that uses one or more forms built with the visual builder?

Here's a hello world:

  use strict;
  use Prima qw(VB::VBLoader Application);
  my $form = Prima::VBLoad('hello.fm');
  run Prima;

where the hello.fm is below. BTW, did you check Prima::VB::VBLoader
manpage?

# VBForm version file=1.2 builder=0.2
# [preload]
sub
{
        return (
        'Button1' => {
                class => 'Prima::Button',
                module => 'Prima::Buttons',
                profile => {
                        owner => 'Form1',
                        text => 'Hello, world!',
                        origin => [ 30, 32],
                        name => 'Button1',
                        y_centered => 1,
                        x_centered => 1,
                        size => [ 96, 36],
                        onClick => Prima::VB::VBLoader::GO_SUB('
my $self = $_[0];
$::application-> close;
','Button1', 'onClick'),
        }},
        'Form1' => {
                class => 'Prima::Window',
                module => 'Prima::Classes',
                parent => 1,
                code => Prima::VB::VBLoader::GO_SUB(''),
                profile => {
                        width => 156,
                        left => 346,
                        name => 'Form1',
                        origin => [ 346, 418],
                        height => 100,
                        bottom => 418,
                        size => [ 156, 100],
                        sizeDontCare => 0,
                        originDontCare => 0,
        }},
        );
}

-- 
Sincerely,
	Dmitry
--- www.karasik.eu.org ---
Received on Sat 28 Aug 2004 - 18:40:04 CEST

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:05 CET