[Glade-users] XML to Source Code?

Tristan Van Berkom tristan.van.berkom at gmail.com
Wed Feb 24 22:28:45 EST 2010


On Wed, Feb 24, 2010 at 10:22 PM, Jianchun Zhou <jianchun.zhou at gmail.com> wrote:
> Thank you very much.
>
> Here in my glade file there is a object of type GtkWindow, Now I want to
> replace it with another object of type
>
> GtkMyWindow which inherits from GtkWindow.
>
> What should I do?

Few things you could do; first start with this:
    http://people.gnome.org/~tvb/testcatalog.xml

Thats an example of a catalog that spoofs a type
with minimal effort and even adds a propery virtually using the xml catalog
format; put it in a directory and fire up Glade with:

GLADE_CATALOG_PATH=~/my_directory glade-3

You can also get Glade to load and introspect your window's properties
and automatically put them in the editor; which is a matter of telling
the same xml catalog where to load the library with your widget inside.

For more information make sure you flip through the first few chapters of:
    http://library.gnome.org/devel/gladeui/3.6/

Note that after the type is encoded in the glade file then GtkBuilder should
be able to dynamically load your object at run time simply by name.

Cheers,
        -Tristan


>
> Thanks.
>
> On Thu, Feb 25, 2010 at 11:06 AM, Tristan Van Berkom
> <tristan.van.berkom at gmail.com> wrote:
>>
>> On Wed, Feb 24, 2010 at 9:47 PM, Jianchun Zhou <jianchun.zhou at gmail.com>
>> wrote:
>> > Dear List:
>> >
>> > In Glade 3, how can I get source code from glade xml file?
>>
>> You dont; you use the GtkBuilder api to parse it and build the interface
>> for your application; GtkBuilder is a part of GTK+ and so should be
>> available in your language binding (if you are using one).
>>
>> Cheers,
>>     -Tristan
>
>
>
> --
> Best Regards
>


More information about the Glade-users mailing list