Re: [gtk-list] Re: announce: yet another gtk+ C++ wrapper
- From: Tero Pulkkinen <terop students cc tut fi>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: announce: yet another gtk+ C++ wrapper
- Date: 17 Sep 1998 16:59:53 +0300
Mario Motta <mmotta@guest.net> writes:
> >I was one of the people who most recently rewrotepart of gtk-- signal
> >frame, and I would love to find some feature that would be useful to
>
>the users. I have proposed a number of extentions to it, but
>
>most were deemed not necessary
>
>
> - could be useful a signal_emit that recurses among object hierarchy.
I've been thinking of adding "visitor pattern" implementation to
Gtk--. This would basically allow people add new virtual metthods to
Gtk_Objects and have algorithms (like object tree traversal) to call
them, just like normal virtual functions. (They can do about the same
now, but the algo is required to test if the object supports certain
interface using dynamic cast => its not reasonable) Then users can
call those virtual functions and have their widgets override the
calls. -- for objects which does not support the method, some default
behavior could be invoked.
(though, I dont see any reason why this should be any way connected to the
signal system...)
> - also a value returning callbacks should be useful
There exists those. Gtk uses then for Gtk_Widget::*_event signals.
Similarly user defined signals can be defined that returns value.
Signal1_r<rettype, firstargtype> sig1;
what we still might need to add is different kind of handlers for that return
type, so that people can override the function that goes trough the list.
> - also callbacks with different args list should be useful (i don't remember
> if already implemented in gtk--) i did'nt implement yet too.
what you mean different arg list? You can make
Signal2<int,int> sig;
and then connect
void f(int,int); (or void f(int,int,T), where T is any type)
to it.
(I'm not sure if you did mean exactly this, but if not, let me know what
you were thinking about.)
--
-- Tero Pulkkinen -- terop@modeemi.cs.tut.fi --
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]