Good morning:

I've recently ported several C++ wxIndustrial Controls to wxPerl and I'm
now abstracting the LinearMeter example  into a module so that multiple
meters can exist on a window. I have a couple of questions that I hope the
group can help me with.

First: I create a frame. Create 6 panels. Write a label on each panel(just
to see if the panel is created in the correct location, it is). Create 6
meter objects. And draw the 6 meters(for testing just a filled box).

Instead of getting a window with 6 boxes with labels, I get a blank window
that gets 6 boxes drawn on it. Then the window goes back to the default
background color with 6 labels written on it. The filled boxes are
overwritten. I'm looking for 6 filled boxes with a label on them. What have
I missed?

Second: In the original port I have the following construct that works fine:

             my @TagsVal;
             push(@TagsVal, $val);

            In my abstracted version I have translated this to:

            $self->{TAGSVAL} = [];                       # Object array
definition

            sub TagsVal {                                     # Object
accessor definition
            my $self = shift;
            if(@_) {$self->{TAGSVAL} = @_}
            return $self->{TAGSVAL};
            }

            push($Meter->TagsVal(), $val);             # Don't think this
is correct syntax???
                                                                     # want
to push $val into the object TAGSVAL array


Thanks for your input!

James

Source files attached: LinearMeter.pl      Original Port
                                 LinearMeter.pm    Object version
                                 LM.pl                   Object Main
Program

Attachment: LinearMeter.pl
Description: Binary data

Attachment: LinearMeter.pm
Description: Binary data

Attachment: LM.pl
Description: Binary data

Reply via email to