[Glade-devel] GnomeDb Catalog for Glade3 - Questions and First XML version
- From: tristan.van.berkom at gmail.com (Tristan Van Berkom)
- Subject: [Glade-devel] GnomeDb Catalog for Glade3 - Questions and First XML version
- Date: Tue, 04 Jul 2006 20:20:07 -0400
Daniel Espinosa wrote:
If I have a property in a Widget, Do I need to define a function to
set it
or Glade3 use g_object_set (May be using a GladeProperty object) to sets
properties of the Widget? If is it, do I need to write in the property
"id"
in the catalog the exact name of the Widget's property defined in the
API?
The glade3 core will detect all the properties installed on the GObject and
display them in the editor and set the object's value in the runtime when it
changes.
It is up to you to disable any properties that dont make sence to have
in the glade file... also, if its inapropriate to actually set the value
on the
runtime object, it is up to you to say so (by marking that property with the
"ignore" property).
setter functions are only needed to update values that cant be updated in
a normal way... or when using a virtual property to augment the experience
(like the builtin "stock" property type: you need to trap it's state in
order
to set the appropriate meaningfull properties on the object itself), or when
doing anything fancy or extra complex :)
Sometimes its also needed to handle incomming properties at load time, for
example, the GtkButton is a little complex because there are various ways to
set one up. At load time it must determine whether the virtual "edit mode"
property is going to be CONTAINER, LABEL or STOCK (similar code is needed
for GtkImage).
If in the widget's API expose a function to set that property, do I
need to
use that function or allow Glade3 to set it self?
This is becouse I notice that in gnome catalog exist some properties that
don't define a function to set it, just sets the id and the default
value.
Yes,
sometimes its a good thing to change the default of a property on
a widget instead of using the default defined by the GParamSpec,
for example, we set all non-toplevel widgets `visible="True"' by default.
Note also an important part is i18n'ness, all the enum and flag types should
have displayable-values declared (they are a more human-readable and also
translatable form of the enum values to be used in the editor).
Note also that all the values in the catalog are translatable are mentioned
in the docs (title, name, tooltip and the widget group name), they
should all
be marked for translation in the catalog.xml.in file (this ensures that
the po
files are also updated).
I hope I've clarified some things for you, feel free to ask more
questions :)
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]