logo       

[RFC] Gtk2::Ex::GladeCustom: msg#00114

Subject: [RFC] Gtk2::Ex::GladeCustom
Hello All,

Writing custom widgets in Gtk2-perl is easy enough to be useful. What's
missing from the distribution is a way to include such widgets in
GladeXML files. Therefore I suggest a module to simplify this.

To create a glade-aware widget, a statement like:

    package MyNewWidget;

    use Gtk2::Ex::GladeCustom my_new_widget => sub { __PACKAGE__->new(@_); };

should be added to the package implementing the widget. Then it can be
called in several ways from the Glade file:

    * The constructor function can contain either:
        - my_new_widget
            The closure passed will be called. This works if the
            function was registered as above.
        - MyNewWidget::my_new_widget
            Fully qualified function is looked up in the perl namespace.
            No need to register it.
        - MyNewWidget
            A package-name. This will call MyNewWidget->new, if it
            exists.
    * The parameters can be:
        - The first string parameter is in parenthesis:
            Then it's expanded to a parameter list (using eval) and
            passed to the called function.
        - The four parameters -- string1, string2, int1 and int2 are
          passed.

This way if the widget itself is not glade-aware, the application still
can build it. Downside of this is, that once this module is used, custom
widgets implemented in C can no longer be called, because the default
widget-building function is not available (not even for C programs :-(
) to be used as a callback.

I have a code for this module here. I'd like to hear comments to the
interface and comments to it's name (Gtk2::Ex::GladeCustom,
Gtk2::Ex::GladeXML::Custom, Gtk2::GladeXML::Custom, ... other ideas?).

PS: Can I hope to see central distribution for Gtk2::Ex* one day?

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe