Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Usage: init(class) @ GTK

by tcf22 (Priest)
on Dec 13, 2003 at 22:08 UTC ( #314561=note: print w/ replies, xml ) Need Help??


in reply to Usage: init(class) @ GTK

In the CPAN docs it, the calls it init() without any arguments. Try replacing

Gtk2->init(\@ARGV);
with
Gtk2->init();
Update: when calling a PACKAGE->method(), the class is passed as the first argument automatically. So that is where Usage: init(class) comes in.

Example:
#!/usr/bin/perl use strict; use warnings; Tom->init; package Tom; sub init(){ print "Calling init\n"; print "$_\n" for(@_); } __OUTPUT__ Calling init Tom

- Tom


Comment on Re: Usage: init(class) @ GTK
Select or Download Code
Replies are listed 'Best First'.
Re: Re: Usage: init(class) @ GTK
by traveler (Parson) on Dec 13, 2003 at 22:15 UTC
    tcf22 is correct. Where is the example you quoted so I can report it to the Gtk2 team if is in the Gtk2 stuff? You can also start Gtk2 with use Gtk2 -init; and then init is called for you.

    --traveler

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://314561]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2015-07-08 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls