[Glade-users] XML to Source Code?

felixonta at gmail.com felixonta at gmail.com
Thu Feb 25 02:49:18 EST 2010


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>  
> 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

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

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?

Thanks.

> >

> > 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

> >

> _______________________________________________

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

> http://lists.ximian.com/mailman/listinfo/glade-users

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


More information about the Glade-users mailing list