Re: Creating custom widget in Perl



Hello Lupus!

Thanks for the patience and thanks for the answers, but I have some more
things, what I don't understand clearly...

/--- On Wed, Feb 21, 2001 at 06:33:59PM +0100, Paolo Molaro wrote:
| Check also Gtk/samples/widget.pl in the sources. Some of the perl gimp
| plugins also use register_subtype.

:-) Google did not find these files when I have searched for
:GTK_OBJECT_INIT, Altavista did, and I checked it after and widget.pl
:has worked. That's how I reduced the problem.

| $ perl -MGtk=-init -e 'print UNIVERSAL::can("Gtk::Button","new"),
| "\n"' CODE(0x815775c)

In my version, it returns still undef! I use the CVS version of
gnome-perl. I am now downloading the debian package of 0.7005.

| register_subtype() is a method in the Gtk::Object package, it will
| register a new object type within the Gtk type system.

Why do I need to register my widget to the hierarchy? Isn't @ISA enough
for it? I cannot find similar function in GTK+.

| Hope the ascii art makes sense:-)

Yes, it does :-)

| GTK_CLASS_INIT() can be used to do perl-type initialization (for
| example adding signals or args to a class). This gets called once.

It's ok.

| GTK_OBJECT_INIT?() is used for object-specific initialization and gets
| called for every object you create in that package.

Why we don't use "new" for it? Why it is better?

| > - What are the "args" good for?
|

What advantages are the Gtk-style data handling over the perl hash
keys? Why use Gtk args, if I have a hash reference, where I can
store everything about this widget? What internal Gtk thing wants to
access this?

\---

dLux
--
  Hal 9000 - "Put down those Windows disks Dave.... Dave? DAVE!!"




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]