Re: GtkBuilder bug?



On Wed, 2008-02-27 at 17:38 -0600, Yevgen Muntyan wrote:
> On Feb 27, 2008, at 16:31 , Emmanuele Bassi wrote:
> 
> >
> > On Wed, 2008-02-27 at 22:20 +0000, Ross Burton wrote:
> >> On Wed, 2008-02-27 at 22:32 +0100, Mikkel Kamstrup Erlandsen wrote:
> >>> Hmmm. This sounds like a very narrow minded decision to me. I have
> >>> been planning to write write a framework where one can send  
> >>> GtkBuilder
> >>> XML snippets to a DBus service and have that service embed this  
> >>> as out
> >>> of process plugins.
> >>>
> >>> The described GtkBuilder behavior forces me to write a separate
> >>> validator before I pass it to the GtkBuilder. Bugger.
> >>
> >> I don't believe that any data passed to a library should result in a
> >> fatal warning, surely a GError return would be a far better option  
> >> here.
> >
> > this is data building your UI: it screams design tool, developer or
> > packager error, and I would expect GtkBuilder to error out very, very
> > quickly. if it were user input, or application data it would have  
> > been a
> > completely different story - but the UI layout of an application *is*
> > the application, it's not user data.
> 
> 
> But nobody can tell that the particular chunk of XML is
> "the UI layout of an application". It's not gtk_main_form(),
> it's gtk_parse_this_xml_and_build_something_of_it().
> A plugin loading its UI from xml, is it user data, application
> data, or ...? (I don't quite understand how a glade file in
> /usr/share may or may not be The UI and not data, but then
> I also don't understand how people write applications which need
> a glade file on disk to start, so that's another story)
> Anyway, libglade doesn't crash, so it's a regression ;)

It can be user-data... I've experimented with using libglade to add
user-defined widgets to a schematic editor's canvas, and a crash / abort
is NOT what we want when the user hand-edits the XML and makes a
mistake.

Actually, there _was_ a bug in libglade, (now fixed) which caused it to
corrupt memory and crash if passed bad XML. (I discovered it with this
very test-case, my badly hand-edited XML.)

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



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