Re: [GSoC] GtkBuilder + GBinding: Connecting transformation functions

Am 20.07.2011 18:09, schrieb Denis Washington:

As you might know, I have created a GTK+ branch on (named
"gtkbuilder-gbinding") which adds a <binding> element to the GtkBuilder
syntax for my GSoC project [1]. Now I would like to add support for
specifying a transformation function from the source to the target
property value for a binding. Like signal handlers currently, such
tranformation functions should be automatically connectable by a
GtkBuilder object.

The question now is where to put this connection logic. There are
essentially two options:

* Do this in gtk_builder_connect_signals(). This lets me reuse the code
that's already there, which, given that the needed operations are almost
exactly the same, would be nice. However, this makes connect_signals()
kind of a misnomer, as it would then connect signals *and* tranformation
functions. (A gtk_builder_connect() alias could be introduced to
alleviate this.)

* Introduce a new gtk_builder_connect_bindings() (or similarly named)
function. This would have the advantage that connect_signals() would
continue to do only what the name implies. However, this will probably
mean some duplication of work and would require GTK+ users to call two
instead of one connection function with the exact same arguments.

As I naturally would like to have my branch merged into GTK+ master
eventually, I am asking you for your thoughts on this matter.

As I didn't receive any feedback yet, I went ahead and moved all property binding creation code to two new public functions gtk_builder_create_bindings() and gtk_builder_create_bindings_full() for now (all in my "gtkbuilder-gbinding" branch, naturally). They work exactly like gtk_builder_connect_signals*(). The code is pushed to and ready for review. (There most probably won't be any other feature that will be added to the GTK+ branch, so I consider it feature-complete.)


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