Niels,

Please consider joining the mailing list:

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

I'd like to keep these conversations there, and non-members can't post.

> Okay, i've read up on that and i think i got a grasp of it now.
> I've changed my Workspace class so that the binding looks like this now:
> 
>   def OnMouseMotion(self, event):
>       if event.RightIsDown():
>        import GUIMode
>        self.canvas.SetMode(Mode=GUIMode.GUIMove(self.canvas))

You've misunderstood a bit. You want to set the Mode when you want to 
scroll the canvas around -- it will then bind the mouse motion events 
and do the right thing. You don't want the Mode to be set on every mouse 
event.

What the Modes do is define what should happen with all the mouse 
events. I have no idea what would happen if you set the mode in a mouse 
event handler -- strange things, I'd guess.

>   File "workspace.py", line 454, in OnMouseMotion
>     import GUIMode
> ImportError: No module named GUIMode

> At the start of the file, i made sure i have the same imports as in 
> NavCanvas.py.

NavCanvas lives inside the floatcanvas package, so it can directly 
import GUIMode, which is also in the package. I think you need:

from floatcanvas import GUIMode as GUIMode

floatcanvas needs to be on your import path somehow.

> Maybe i should add that in the meanwhile i installed the latest 
> FloatCanvas Version from SVN, as far as i understood it, GUIMode isn't 
> available in older versions.

The functionality is there, but it's structured differently. The recent 
version is better though, 'cause it is better structured, and we'll try 
to fix bugs in that one if you find them.

-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

[EMAIL PROTECTED]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to