Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

XUL::Gui onload

by David S (Sexton)
on Jan 23, 2011 at 00:50 UTC ( [id://883731]=perlquestion: print w/replies, xml ) Need Help??

David S has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use XUL::Gui and I would like to be able to call a sub when the window is loaded. I have the following code, but the WindowLoaded() sub does not get called. Does anyone know the proper way to get onload to work for a window?

Thanks, David

use XUL::Gui; display Window ( onload => \&WindowLoaded, id => "window", title => "Test Window", Button(label=>'Test', oncommand=>\&ButtonHandler) ); sub WindowLoaded { print "in WindowLoaded\n"; } sub ButtonHandler { print "in ButtonHandler\n"; }

Replies are listed 'Best First'.
Re: XUL::Gui onload
by toolic (Bishop) on Jan 23, 2011 at 01:12 UTC
      Yes, I posted a question/bug there and since I hadn't heard back I thought I'd ask here. I've gotten help here in the past and hoped to get help again.
Re: XUL::Gui onload
by PeterPeiGuo (Hermit) on Jan 23, 2011 at 22:45 UTC

    Your code was fine (at least with strawberry perl and XUL::Gui 0.20). The WindowLoaded method was called, and the message did show up in the command window (not in the browser though, just in case that's where you checked).

    Peter (Guo) Pei

      Thanks. Yes, expected the message to be in the command window. Doesn't work with AS Perl 5.8.8 and XUL::Gui 0.63.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://883731]
Approved by Anonyrnous Monk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-23 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found