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

Re: Allow code in glade callbacks?



On Thu, 2004-03-25 at 19:35, Pascal Giard wrote: 
> > i know some people have in the past expressed the opinion that keeping  
> > code out of the xml ui description is A Good Thing, but it would be  
> > pretty convenient.
> 
> i agree it's convenient IF used smartly...
> ca we assume that?

My $.02:

It's the wrong thing to do, but solves a real usability problem.  I
suspect there is something else that could be done that solves the same
need, but in a 'right' way.  In fact, I think that this is where we
could out-innovate the non-Free world ;)

Why is it wrong?  Two reasons:

1. What language will it embed?  What happens when you want to switch?

2. Does the embedded language conform to the limitations imposed by XML
(illegal characters, etc.)?

Some solutions:

* Turn the simple into data (XML).  Instead of Gtk->main_quit, have a
property that libglade understands like quit="1".

* Connect glade with source-editing.  Ugly, difficult, but similar to
MS/Borland apps.  Entering code puts it into a source file, but not in
the XML.


> in most cases, i'd still put the code out of the XML, but as mentionned in the tracker, it would
> be usefull for some exceptions that onyl require a one-liner.

That brings up an interesting point: Connecting glade to editing
(somehow, magically) would be a great boon to new Gtk developers.  If
only there was a way to do it that wasn't annoying/language limited.



-- 
Bruce Alderson <bruce warpedvisions org>
-- 
Bruce Alderson <mx warpedvisions org>




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