Re: I need another hint Setting properties

From: Dmitry Karasik <dmitry_at_karasik.eu.org>
Date: Sun, 28 Dec 2008 09:49:02 +0100
To: tjg_at_gimmel.org

        Hi Tim!

On 28 ΔΕΛ 08 at 08:13, "Tim" (Tim Gimmel) wrote:

>> I'm unsure about what do you mean by "calling the objects".
 Tim> Changing the properties of different widgets in the "window", like
 Tim> enabling a button, changing text, etc.

 Ah, I see. $self-> enabled(1), $self->text('text') is the usual
way to do that.

 Tim> Yes, almost. I need to get to widgets from the built in code editor.

It's possible, but not in a straightforward manner. Code from the code
editor is executed before the form is even created. What you could do, is
inside Form::onCreate state f.ex. "$myprogram::form = $self;", so in
the later code the main form can be accessed that way, and the label
you need as $myprogram::form->lblUSB. The problem with this approach is
that only one form can be accessed that way, but it is easily fought
by doing something similar to "$myprogram::forms{ $self-> name } = $self"
instead.

 Tim> I cannot find anywhere in the .frm file an object name that I can
 Tim> use! I guess I am really confused where all the name-spaces reside.

You need to give that name first in object inspector in the "name" field.

-- 
Sincerely,
	Dmitry Karasik
Received on Sun 28 Dec 2008 - 09:49:05 CET

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