interactive 2D

hello,

i'd like to use python for a project involving a cross-platform 2D user interface.

mid-90's i was working with tcl/tk, and i am looking for something that will have a similar mechanism as tk's canvas where objects are created and can be bound to callbacks when certain events occur (mouseover, drag parameters, click, etc.).

is the wx.GraphicsContext able to do this? the demo is not responding to user events and a quick look at the docs did not make it clear to me. it seems i can manually test if a given coordinate is inside an path, but i'm looking for something a bit higher level...

or is there another wxpython "builtin" 2D graphic class? (although wx.GraphicsContext's floating point resolution and cross-platform native graphic wrappers are very attractive...). googling around pointed to different things (floatcanvas, ogl) but none seemed too impressive or forward-looking.

or would tkinter still be a good idea? intuitively i would stay away from it but maybe i should reunite with the old friend...? from a 2007 point of view i find the wx lib (docs) in general much better than what tkinter offers but maybe i'm wrong...

thanks!
alexandre.

hello,

i'd like to use python for a project involving a cross-platform 2D
user interface.

mid-90's i was working with tcl/tk, and i am looking for something
that will have a similar mechanism as tk's canvas where objects are
created and can be bound to callbacks when certain events occur
(mouseover, drag parameters, click, etc.).

is the wx.GraphicsContext able to do this? the demo is not responding
to user events and a quick look at the docs did not make it clear to
me. it seems i can manually test if a given coordinate is inside an
path, but i'm looking for something a bit higher level...

or is there another wxpython "builtin" 2D graphic class? (although
wx.GraphicsContext's floating point resolution and cross-platform
native graphic wrappers are very attractive...). googling around
pointed to different things (floatcanvas, ogl) but none seemed too
impressive or forward-looking.

or would tkinter still be a good idea? intuitively i would stay away
from it but maybe i should reunite with the old friend...? from a
2007 point of view i find the wx lib (docs) in general much better
than what tkinter offers but maybe i'm wrong...

thanks!
alexandre.

Theres a number of 2d object solutions - look at wx.lib.floatcanvas
and wx.lib.ogl.

GraphicsContext doesn't have it built in, but it wouldn't be too hard
to build one on top of it. GraphicsPaths have hittesting, although I
think you need to manage Z order yourself.

An OGL or floatcanvas compatible API (I tried just hacking OGL to use
GCDC everywhere, it didn't work because of the use it makes of
ClientDC) on top of GraphicsContext would be nice.

···

On 2/13/07, alexandre burton <burton@artificiel.org> wrote:

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

alexandre burton wrote:

hello,

i'd like to use python for a project involving a cross-platform 2D user interface.

mid-90's i was working with tcl/tk, and i am looking for something that will have a similar mechanism as tk's canvas where objects are created and can be bound to callbacks when certain events occur (mouseover, drag parameters, click, etc.).

is the wx.GraphicsContext able to do this? the demo is not responding to user events and a quick look at the docs did not make it clear to me. it seems i can manually test if a given coordinate is inside an path, but i'm looking for something a bit higher level...

No, wx.GraphicsContext is just focused on 2D drawing (with alpha and anti-aliasing) and doesn't have any interactivity solutions built-in.

or is there another wxpython "builtin" 2D graphic class? (although wx.GraphicsContext's floating point resolution and cross-platform native graphic wrappers are very attractive...). googling around pointed to different things (floatcanvas, ogl) but none seemed too impressive or forward-looking.

FloatCanvas is still being activly maintained by its original author (who I expect will chime in on this thread soon) and is improving at a steady rate. He has also mentioned the possibility of moving to rendering with the new wx.GraphicsContext classes.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

alexandre burton wrote:

different things (floatcanvas, ogl) but none seemed too impressive or
forward-looking.

FWIW, FloatCanvas has more to it than it appears from the demo, and
while I won't comment on what you should be impressed by, what's not
forward-looking about it? That aside, it has the features you have
described. Check out the latest release, with more demos at:

http://www.mithis.com/~chrisb/

and a mailing list at:

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

or would tkinter still be a good idea? intuitively i would stay away
from it but maybe i should reunite with the old friend...? from a
2007 point of view i find the wx lib (docs) in general much better
than what tkinter offers but maybe i'm wrong...

well, the TK Canvas (and the text widget) is very well regarded.
However, I think you are better off with wx for everything else.

I made no effort whatsoever to clone the tk Canvas when I built
FloatCanvas, but I think it does do most of the same things, and some
more. In any case, I don't think there's anything better at this point
with wx. If you need other features, I know I'd much rather you
contributed to FloatCanvas than started something new.

FloatCanvas is still being actively maintained by its original author
(who I expect will chime in on this thread soon)

as predicted....

> and is improving at a steady rate.

Though I've done a very bad job of updating the version delivered with wxPython. Sorry about that.

> He has also mentioned the possibility of moving to

rendering with the new wx.GraphicsContext classes.

Yes, I'd love to do that. I'm not sure when though. Contributions welcome. It shouldn't be too hard, but there will be a little bit of infrastructure changes to accommodate alpha values in colors, etc. The hit test stuff may take some major re-working too.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

FWIW, FloatCanvas has more to it than it appears from the demo, and
while I won't comment on what you should be impressed by, what's not
forward-looking about it? That aside, it has the features you have
described. Check out the latest release, with more demos at:

http://www.mithis.com/~chrisb/

thanks for this info chris! the google results for python floatcanvas did not lead me to your site and it was not clear if it was actively maintained -- i found references to it feeling "slightly out of place" and that "It doesn't currently support interactivity very well" (albeit 2004).

anyway, i've installed 0.9.17 and will be looking at it,

it would be nice for "wanderers" like me if the wxpython demo application overview had a reference to your example repository.

thanks again,
alexandre.

alexandre burton wrote:

it would be nice for "wanderers" like me if the wxpython demo application overview had a reference to your example repository.

It sure should -- I have been very behind in updating the version in the wxPython lib; I hope to correct that next week, though I may miss the next release. When I do, the notes will bu updated too, that web site is fairly new, and as you can see extremely sparse!

Anyone who wants to help is welcome to!

I'm looking forward to hearing what you think about it. Please post comments to the FloatCanvas mailing list if you can, that way it gets archived.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov