canvases, zooming widgets, printing, and timelines

Simson Garfinkel wrote:

Here's my current beef. I spent much of the 1990s being a NeXTSTEP programmer. NeXTSTEP is now called Cocoa and it's the basis of the Mac OS X GUI. But I can't use NeXTSTEP because I want my code to run on Linux.

Have you checked out GnuStep? Maybe not robust enough, but it's there.

I have. It's not. Also, I want my stuff to be used by a large number of people. GnuStep would preclude that.

With NeXTSTEP, printing is pretty easy. You just send a message to your object and it prints. Or it makes PDF or PS code that can be saved away. Simple.

I think NeXTSTEP is built, from the core, on top of displayPS (and now DisplayPDF). Which is a nice design decision, as it makes this kind of thing easy.

It's true, but frankly, the whole thing could have been done in wxwidgets as well. It's not that hard.

After about an hour of work I got printing under wxwidgets to work. I'm amazed that you can't just send a print() message to the Frame class and have the Frame print.

wxWidgets, on the other hand, is built on top of a number of native toolkits, and let's them draw their own widgets, so there is no one drawing API to make this easy.

Good point.

So my wx.Printout subclass calls theframe.Paint( self.GetDC()). It's a mess, but at least I can try to hide some of the mess.

this is the conventional way to do it. I don't think it's such a mess though, is seems clean to me. However, drawing is, in general, more complicated than it could/should be. Depending on your needs, you may want to check out one of the higher level drawing canvases:

system because I don't have OpenGL installed). floatcanvas looks like a great start, but I'm hadpressed to find some decent examples. Should I use it?

That depends on your needs. What are you trying to do?

I'm trying to create an interactive, scalable timeline display. I looked around and couldn't find one.

2. I'd like to drop the float canvas into a scrolling view that supports zoom and mouse events. Again, the wxPython demo seems to have the start of a system, but it's really big and intermixes the code that makes the canvas with the code that makes the demo. Do we have anything clean?

There are a bunch more examples in the FloatCanvas SVN:

http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/FloatCanvas/Demos

Those are all small, self contained apps.

Though the demo and the canvas aren't intermixed -- FloatCanvas itself is in wx.lib.floatcanvas

There are now two FloatCanvas -- there is a new version, started with funding from Google Summer of Code:

http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/branches/FloatCanvas/SOC2008_FloatCanvas/

The new version has a greater levels of abstraction that make it more powerful and flexible, but it also less mature, and I"m not sure it's rendering right on GTK at this point.

Please join us on the floatcanvas mailing list for more detail:

http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Sounds good. I will join shortly. Thanks for the email.

3. I'm actually interested in some graphical depictions of timelines. Is there anything pre-packaged ready to go?

I don't think so, though someone was working on something similar a little while back -- you might check the archives of this list.

Look for posts by Stephanie Lück

Thanks. I'll look around.

Regards,

Simson