attaching callbacks (was Re: arguments to -render . . .)

Robert Graham Merkel rgmerk@mira.net
Wed, 17 Jan 2001 15:30:43 +1100


Bill Gribble writes:
 > On Tue, Jan 16, 2001 at 03:53:49PM +1100, Robert Graham Merkel wrote:
 > > Hey grib, I'm almost to the point of doing useful things
 > > with panes (finally).  One of the final things that needs
 > > to be in place is a renderer along the lines of the 
 > > gnc:html-*foo*-render that are required to display guppi
 > > charts in reports.
 > 
 > I'm skeptical that this is what you need.  The html-*-render functions
 > are strictly for block-level structural elements of HTML, and I don't
 > think you are defining any new kinds of block level HTML elements, are
 > you?
 > 
 > Tell me more about what you are doing.  Oh, wait.. are you talking
 > about a renderer for the mainwindow account tree?  That makes sense.
 > 

Correct.  Sorry I wasn't more explicit.

 > To answer your question, the arguments to the html-foo-render
 > functions are (1) the object to render and (2) the HTML document to
 > render into.  You need to have the document in order to get inherited
 > style infomation.  ATM, the Guppi objects all ignore the style
 > information since they are sort of a special case of HTML rendering,
 > but in the future they might respect 'data style' (for example how
 > many decimal digits to display in legends) or default colors or
 > somesuch.
 > 
yep, makes sense.  I get suspicious in guile when I see functions with
fewer or more arguments than they use - it tends to suggest there's
something  going on I don't understand :-)

 > To add a new type of html object, you need to do two things: basically
 > cut-n-paste html-piechart.scm with appropriate changes for the new
 > object type, then patch the 'cond' statement at html-document.scm:341
 > to add the new class.  This is a bassackwards attempt to get some sort
 > of genericity... with a real object system there would be an
 > inheritance relationship between <html-object> and the various
 > <html-foo> classes.

Yep.  Maybe in the future GOOPS will be the go for this sort of thing.

 > Hope this is clear.  Let me know if it ain't.

Yep.  The only thing I need to figure out is "callbacks".  Your example
account-tree report doesn't mention them.  I'm about to dig through
the code to see if I can figure it out.

Thanks for your help.

------------------------------------------------------------
Robert Merkel	                           rgmerk@mira.net

"We are excited and optimistic about its usage going 
forward and, yes, we can teach penguins the military 
close-order drill", Mark Norton, US Department of Defense. 
------------------------------------------------------------