[Glade-users] custom properties stored in glade xml file

On Tue, 14 Dec 2004 12:56:30 -0700, Neil Zanella <nzanella gmail com> wrote:
I suggested this before, but it has some problems. (you can't set pointers to
data via your method, only strings and integers (but not enumerations from
within the code either)

I use a method that has a config file in .ini file format ([section] key=value)
 after the glade tab is loaded a recursive funcion is called "bind_data" that
rccurses down through the widget tree and looks for keys/values to load from
the conf file and loads them.  It's not very pretty, but it works extremely
well for my application.

Yeah,so we can have another XML file sitting around with other
configuration data.
But that is precisely what I don't want. The whole point is, the
developer shouldn't
have to key in widget names in the source code when it could be avoided by
storing custom properties in the glade file via the glade gui builder.

I'm not sure I understand what you are suggesting, you want to introduce
a function like:

gpointer glade_xml_get_custom_property(const gchar *key);

into libglade (highly unlikely IMO) ?

or you want to define custom properties (as described in the glade-3 xml
catalog) that are editable from the property editor and can later be retrieved
like so:

GtkWidget *widget = glade_xml_get_widget (xml, "mywidget");
gpointer      custom_prop = g_object_get_data (G_OBJECT (widget), "myprop");

or are you proposing something entirely different ?

Also, is glade pluggable into eclipse? For instance, can I write yet
another plugin, so that,
when I click on an XML file line, property editor comes up with the
widget of interest
where the cursor is located? Just wondering. Could be handy.

glade-3 was designed to be be pluggable to an IDE, we're definitly
not there yet though (maybe sometime next year ?).


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