Re: How Do I get WM Decorations and Pixmaps to work [gtk1-perl]?



Mauricio Silveira said:
I'm not using Gtk2-Perl because these is no Reference such as Gtk1-perl's
Gtk::reference or Gtk::object man-pages. Any hints?

the c api docs function as a much more useful api reference than just a list
of functions. so that's the way to go. there were people on the list who've
discussed full api documentation for gtk2-perl and it may happen, but not for
1.0. up to this point no effort has been put into a list of functions b/c just
knowing the names isn't all that useful. it has been discussed though.

if all you want is a list of functions then take a look at the patch attached
to this message:
http://mail.gnome.org/archives/gtk-perl-list/2003-September/msg00125.html

bascially just add the code below to your script (temporarily) and then you'll
be able to call $g_object_based_thing->methods for a list of methods on
anything that derives from a gobject, which is basically all of gtk.

-rm

package Glib::Object;
# based on (and/or copied from) code at: http://dev.perl.org/perl6/rfc/335.html
# main changes are levels rather than all, puttting package name before it,
# and also getting rid of the wantarray stuff
sub methods
{
        my ($class, $levels) = @_;
        $class = ref $class || $class;
        $levels ||= -1;
        my %classes_seen;
        my @methods;
        my @class = ($class);
        my $level = 0;

        no strict 'refs';
        while ($class = shift @class)
        {
                next if $classes_seen{$class}++;
                unshift @class, @{"${class}::ISA"}
                        if $levels > $level or $levels < 0;
                # Based on methods_via() in perl5db.pl
                for my $method (grep {not /^[(_]/ and
                                defined &{${"${class}::"}{$_}}}
                                keys %{"${class}::"})
                {
                        push @methods, "$class->$method"
                }

                $level++;
        }

        sort @methods;
}
package main;



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