Re: Return values from gtk2 widget (void) methods



Guillaume Cottenceau wrote:

Dermot Musgrove <dermot glade perl connectfree co uk> writes:

So what should happen? As a perler, I like the idea of returning 'true
when they succeed and 'undef' otherwise.' like system calls. Success is
easy to spot and failures are not easily confused with anything else.

I think it depends on which functions we're talking about.
Gtk2->init has been fixed by Goran to return 1 on success, which
is good. But most gtk functions/methods already have a prototype,
either they have a void return or they return information; we
should keep this, IMHO.
I guess that if it is impossible to tell whether a function has failed
or not, there is no easy way to be selective - I don't understand how
gtk2 C programs (especially custom widgets) work if there is no error
available to check but hey there is a lot I don't understand :)

Perl's eval() seems able to get and return errors (in $@) so I assumed
that it would be possible in Gtk2-Perl too but if this is not the
case then I suppose that we'll have to go with returning whatever
the gtk2 function returns.

Best regards, Dermot




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