[Kde-perl] small issue...
Germain Garand
germain at ebooksfrance.org
Mon Nov 22 21:43:51 CET 2004
Le Dimanche 21 Novembre 2004 06:33, Gary L. Greene Jr. a écrit :
> I'm currently developing a first boot wizard for Ark Linux. I've run into a
> small problem with my applications design though. I've made the top, middle
> and bottom of the application window a separate sub. Unfortunately, I need
> to be able to access the widgetstack in the sub midFrame and Perl keeps
> saying that I cannot access it. is there a way to allow the other sub calls
> to access widgets created inside the other calls? Attached is the source to
> the app thus far. Thanks.
Hello,
I don't know about your specific needs, but the below:
$nextBttn->connect( $nextBttn, SIGNAL 'pressed()',
$wdgt::midFrame, SLOT 'raiseWidget( aboutToShow() )' );
is definetly is wrong.
You can't connect a signal to a generic sub (what is known as a callback), but
only to methods of live object instances.
So what you should do, is store the objects built by your midFrame sub inside
attributes of your stackFrame
(e.g: use Qt::attributes qw| widgetStack |; ) ; then you'll be able to connect
to this specific instancewith a call like:
$nextBttn->connect( $nextBttn, SIGNAL 'pressed()',
widgetStack, SLOT 'raiseWidget( aboutToShow() )' );
see the PerlQt documentation for details about attributes and signals/slots.
Greetings,
Germain
More information about the Kde-perl
mailing list