Re: Visual Builder question, method onClick

From: Dmitry Karasik <dmitry_at_karasik.eu.org>
Date: Wed, 24 Dec 2008 22:55:29 +0100
To: tjg_at_gimmel.org

        Hi Tim!

On 24 ΔΕΛ 08 at 21:29, "Tim" (Tim Gimmel) wrote:

 Tim> I am very unclear on how the onClick method works. The onClick =>
 Tim> Prima::VB::VBLoader::GO_SUB('my $self = $_[0]; makes no sense to me
 Tim> and I have not been able to find the docs to explain this method
 Tim> (clearly).

Hello Tim,

The GO_SUB invocation in .fm files is needed for the dual use of the code.
When a .fm file is loaded using VBLoad, the code is passed through "eval",
and when the file is edited in VB, it is not, but the code can be edited
in the object inspector. The GO_SUB method is not explained because .fm
files are not intended for manual editing.

 Tim> Prima::VBLoad( './FT950.fm', Form1 => { centered => 1 }, )-> execute;

The invocation is correct. All subs stored in FT950.fm will be
processed automatically.

 Tim> Also do I need a "run Prima" statement? It appears the execute
 Tim> method does the trick.

True, that is because execute() is intended for dialog execution, which
is an event loop itself. If you need to run Form1 while other windows
(if any) need to be accessed too, then execute() is not to be used,
while "run Prima" is. For a single form though, execute() is a perfectly
legal invocation.

-- 
Hope this helps,
	Dmitry Karasik
Received on Wed 24 Dec 2008 - 23:02:57 CET

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