Re: GtkBuilder Public API - Last call
- From: Christian Persch <chpe gnome org>
- To: Johan Dahlin <johan gnome org>
- Cc: gtk-devel-list gnome org
- Subject: Re: GtkBuilder Public API - Last call
- Date: Wed, 13 Jun 2007 15:44:09 +0200
Hi;
Le mercredi 13 juin 2007 à 10:01 -0300, Johan Dahlin a écrit :
> Johan Dahlin wrote:
> > Christian Persch wrote:
> >> Hi;
> >>
> >>> typedef void (*GtkBuilderConnectFunc) (GtkBuilder *builder,
> >>> const gchar *handler_name,
> >>> GObject *object,
> >>> const gchar *signal_name,
> >>> GObject *connect_object,
> >>> gboolean after,
> >>> gpointer user_data);
> >> Could we have "GConnectFlags flags" instead of "gboolean after" here, so
> >> this could also support swapped handlers in future?
> >
> > This was copied more or less directly from libglade, there's a certain
> > advantage of making this compatible with the existing code.
> >
I think I misunderstood the API. I thought |user_data| in
gtk_builder_connect_signals_full was the data that the signal handlers
get connected to, but it actually is the data that's passed to the
GtkBuilderConnectFunc function (and the signal handler data is always
NULL with the default builder func, unless it's a connect_object). That
probably makes a destroy notify unnecessary.
The API has no equivalent to glade_xml_signal_connect_data, so one needs
to implement that oneself with a custom connect function?
> Well, actually swapped handlers are supported, using the object attribute, eg:
>
> <object class="GtkButton" id="button"/>
> <object class="GtkEntry" id="entry">
> <signal name="activate" handler="button_clicked" object="button"/>
> </object>
The default builder func uses SWAPPED for this case, yes (why?). I don't
see why every builder func would do the same though, so a way to hint
that from the XML would needed.
> > It definitely makes sense to support GConnectFlags though.
>
> I thought there were other flags apart from after and swapped, so this is
> not true, right?
The only flags that exist now are G_CONNECT_AFTER and G_CONNECT_SWAPPED.
Regards,
Christian
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]