[Kde-perl] Newbie Question

Ashley Winters jahqueel at yahoo.com
Thu Apr 8 07:14:55 CEST 2004


All you need to do is create any widget you want to display, without
giving a "parent" argument, and it will be a toplevel window.

Here's a quick example:

use Qt;
$a = Qt::Application \@ARGV;
$b = Qt::PushButton "Show window", undef;   # undef parent
$b->show;
$w = Qt::Widget;    # no parent again!
$a->setMainWidget($b);
$w->connect($b, SIGNAL "clicked()", SLOT "show()");
$a->exec;

Or, from the command-line:
perl -MQt -e '$a = Qt::Application \@ARGV; $b = Qt::PushButton "Show",
undef; show $b; $w = Qt::Widget; setMainWidget $a $b; $w->connect($b,
SIGNAL "clicked()", SLOT "show()"); $a->exec'

Ashley Winters

--- Joe Claborn <joe at claborn.net> wrote:
> I'm starting to get the hang of perlQT - but tonight I'm stumped.
> 
> I have an application that is a main-window.  There is one place
> where I want 
> to be able to open up another window (like a popup window) to display
> some 
> text and a picture.
> 
> How do I open up another window?  If I'm missing something obvious -
> please 
> point me in the right direction.
> 
> Thanks,
> -- 
> Joe Claborn
> joe at claborn.net
> 254-829-2448
> 
> _______________________________________________
> Kde-perl mailing list
> Kde-perl at kde.org
> https://mail.kde.org/mailman/listinfo/kde-perl


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/


More information about the Kde-perl mailing list