Re: converting from gtk2-perl to gtk2-perl-xs (work in progress)



Thierry Vignaud said:
Steve Fox <drfickle k-lug org> writes:

# ItemFactory creation from hash is bogus: switch to arrays
# this way, you won't miss <type> anyway ...

the current implementation supports both array and hash forms, like
gtk-perl did.  personally, i found the hash form nicely
self-documenting, if verbose; the array form is more concise.

I strongly agree that the hash form is _very_ nice. That's one of the
first things I missed when toying with gtk-perl-inline.

when i swtich from gtk2-perl to gtk2-perl-xs, i got new warnings on menu
building:

(drakboot:5766): Gtk-WARNING **: Attempting to add a widget with type
GtkMenuItem to a GtkMenuItem, but as a GtkBin subclass a GtkMenuItem can
only contain one widget at a time; it already contains a widget of type
GtkAccelLabel


when i replace:
    { path => N("/_File"), type => '<Branch>' },
by:
    [ N("/_File"), undef, undef, undef, '<Branch>' ],


these gtk+ warnings disappear ...

so there's something odd somewhere

when i went through and updated the GtkItemFactory to behave more as expected
(mainly concerning callbacks) i renamed all of the parameters to have the same
name as their C counter parts. so where you have type it should be item_type.
my thinking was that if i were to guess what the hash member names where i
would guess the c variable names in the api doc. those names are a little more
explicit and thorough in some case, and i liked that. existing code will need
to be modified (very slightly) but new code written by people new to
ItemFactory will be more straightforward and less of a learning curve will be
required.

-rm





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