[Glade-users] XML to Source Code?

El , Tristan Van Berkom <tristan.van.berkom at gmail.com> escribi?:
On Wed, Feb 24, 2010 at 10:22 PM, Jianchun Zhou jianchun.zhou at gmail.com>  

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:


Thats an example of a catalog that spoofs a type

with minimal effort and even adds a propery virtually using the xml  

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:


Note that after the type is encoded in the glade file then GtkBuilder  

be able to dynamically load your object at run time simply by name.



I didn't mind add a custom widget was pretty easy, and i wonder one forward  

If i add some custom widgets definition on my catalog for my apps, what are  
the best practices when i'm willing to set the code free?
I mean, my custom widgets are part of the app source code so, if i want to  
make easy for the community to help coding, or packaging my software,
i suppose that there must be some "de facto" standards, isn't?



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>


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  

for your application; GtkBuilder is a part of GTK+ and so should be

available in your language binding (if you are using one).




Best Regards


Glade-users maillist - Glade-users at lists.ximian.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100225/154d9d56/attachment.html 

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