Re: GtkBuilder status



Johan Dahlin wrote:
>> Over the last couple of weeks Henrique Romano and I have been working on
>> GtkBuilder, a UI constructor intended for inclusion in GTK+.
>> I'd like to discuss the API and some of the decisions before making the
>> code available for public review.
>>   
> I went ahead and attached the patch to
> http://bugzilla.gnome.org/show_bug.cgi?id=172535

I think you can avoid needing to special-case "has_focus",
"has_default", and "visible" at the GtkBuilder level. Change
gtk_buildable_set_property() so that most of the code is in a default
implementation of the method rather than in the wrapper function, and
have implementations of the method fall back to their parent
set_property() method as needed. Then have GtkWidget implement
buildable.set_property, and let it do the special-casing for those
properties there (and fall back to the default impl for all other
properties). Then you don't need to hope there aren't other properties
that need that sort of special-casing, because if there are, widget
implementors can just special-case them themselves.

The "constructor" property seems like it shouldn't be needed. Can't the
parser figure out automatically that if the object being constructed
implements construct_child, that it should use that to construct its
children? (I might be misinterpreting how it's used...)

gtk_enum_from_string and gtk_flags_from_string seem like they should go
into glib. (Along with their inverses? A flags_to_string function would
often be useful when debugging.) Does gtk_flags_from_string() actually
need to be working in UTF-8 or are those values guaranteed to be ASCII?
And does it need to work with both flag names and flag nicks?
(libglade's equivalent function does because glade uses flag.name for
most properties, but uses flag.nick for table child x_options and
y_options. But if we're changing the file format, we can fix that.)

Does it make sense to pretend that gtk_set_value_from_string() isn't
completely GtkBuilder-specific? The GtkAdjustment handling doesn't seem
very general-use. Moving this function into GtkBuilder would solve the
problem of how to handle GdkPixbuf. And on that topic: one problem with
using glade files in C# is that you generally want the filenames in
pixbuf properties to refer to resource objects that have been compiled
into the exe file, not separate files. So it would be sweet if there was
some way to override GtkBuilder's default filename->pixbuf resolving method.

Tooltips? Custom widgets?

-- Dan



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