Re: gtk2-perl CVS 20021017



Dermot,
thanks a lot for comments and code.

On Fri, Oct 18, 2002 at 04:22:43AM +0100, Dermot Musgrove wrote:
1) If there are any functions eg in src/Gtk2.c update_ui that could be
recursive perhaps the names should be made different by prefixing
them with an '_' underscore (rather than what I did by adding a suffix
of '1') so that Gtk2.pm has sub update_ui that calls _update_ui in the
src.Gtk2.c file.

yes, your right, fixed in CVS

2) The old perl way of connecting signals allowed for multiple items
of data to be passed as args after the callback arg. I don't know how
it works but the effect is that the args to the callback can be got by:
  my ($widget, @data) = @_;

If the callback is for an event, the event structurea is added at the
end so a signal handler could get the args eg:
  my ($class, $data1, $data2, $data3, $event) = @_;

depending on how the signal was connected. I am not sure what the best
answer is - I remember some threads on the gtk-perl list ages ago.

I guess that it might be simplest to insist that all data is passed in
an anonymous array/hash so that only a ref is passed - which is what
happens already I guess :)

Good idea,
could you please add an "feature request" to the project page
so the idea is not lost.

3) I have written (and attached) a Gtk2::Test module and a script that
will generate test scripts for each widget mentioned in the gtk2 docs. 
These scripts can be extended as methods are added. I guess that if you
want to use them it would be best to add them to the t/ directory after 
the widgets are added. 

I didn't get the 041-script to run OK on my machine,
the "use Gtk2::Window" bit failed.
I added them to CVS anyway.


/göran




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