Re: When do custom tick handlers get called?

Al Hooton <[email protected]> Wed, 15 Dec 2004 01:16:08 -0800
Newsgroups gmane.comp.scigraphica.gtkextra
Message-ID <[email protected]>
	Adrian,

On Mon, 2004-12-13 at 12:03 -0800, Adrian E. Feiguin wrote:
> Hi Al. First, let's clarify that the tick_label signal is emitted by 
> canvas_paint when you have used:
> gtk_plot_axis_use_custom_tick_labels (canvas_refresh only updates the 
> backing pixmap in the screen).

	Yep, sorry about that -- was going/typing too fast in my original note,
I meant canvas_paint() everywhere I said _refresh().

>  Everytime the plot is redrawn, the ticks 
> are updated. gtkextra has no way to know if the values have changed or 
> not, so you'll have to do it yourself.

	I'm not asking for a new feature here, just tossing out a question/idea
to discuss: Would it make sense to add some kind of mechanism to
canvas/plots so that axes only have to be redrawn when necessary?  As
you point out, it is certainly possible for the app to cache the values
in an array and avoid recalculating them, but this still leaves the
canvas & plot the job of repainting axes each time, something that takes
a lot of processor cycles too.

	Something along this line:

- Add a property to each axis object  indicating that it is either to be
regenerated on each paint, or that the plot can assume the axis will not
change until this property is reset (changing/not-changing property?).

- Have the canvas build an off-screen pixbuf where it paints each
*unchanging* axis from each child plot.  This has to be repainted
whenever the app changes the changing/not-changing property on any axis,
but only at those times.

- In canvas_paint(), instead of drawing a blank rectangle as the canvas
background, copy the off-screen pixbuf in as the background, and then
have the child plots repaint themselves *except* for the not-changing
axes.

	I know you have way too much going on to do something like this, even
if it is a good idea, which it might well not be.  But, as an idea...
Would something like that make any sense?

	Side note: I just got done with a 60+-hour test run of my app, updating
the display several times per second with real-time dataset changes,
canvas children moving around, etc.  *NO* memory leaks that I can find
in canvas or plot!   8^)=

Best,
Al





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/