2009/3/24 Marco Diego Aurélio Mesquita <[email protected]>: > Hi, > I've been implementing a preview feature for glade but I would like > suggestions on the best way to do it.
Cool :) We probably want a api on the GladeProject that will allow us to preview a said widget in the project, like you say I agree its best to give the user the choice, projects may have more than one toplevel, or may not contain any toplevels at all (in which case we need to parent them somewhere). What I would really like, is something spawned with g_spawn_async_with_pipes, and capture the errors through the pipe so we can report them back in the Glade process (would be also nice if glade had a fancy logging system to save and display logs by domain/project/widget etc but thats another story, for now it would be nice if Glade could at least capture error messages that may have prevented the preview from showing and at least showing a window from Glade about those errors would be enough). I'm really really busy these days but I'll try my best to answer all your questions and guide you through the source as much as I can... > > As of now, the implementation is pretty hackish: it saves a > /tmp/out.glade file, loads it with gtkbuilder, get the window1 object > and shows it. > > Of course, doing it this way will not work for projects that do not > have a widget named window1. And it is clear that this is not the best > strategy, so I have several questions on how to do it right. > > I will investigate trough glade save functions to find a way to get > the string of the saved file so that it won't be needed to save the > file. But, how can I get the name of a toplevel object in glade? > Should we ask the user witch object to preview? Isn't it the best way > to do it? What better alternative to implement a preview feature in > glade? > _______________________________________________ > Glade-devel maillist - [email protected] > http://lists.ximian.com/mailman/listinfo/glade-devel > _______________________________________________ Glade-devel maillist - [email protected] http://lists.ximian.com/mailman/listinfo/glade-devel
