On Oct 17, 2010, at 6:48 AM, Fraser Burns wrote:

> So carrying on the pycon tutorial...
> I then tried the command window.
> Everything works as instructed except the getMouseObject()
> 
> The button was created but didn't move etc
> I asked it to show btn and it showed:
> <edtCode (baseclass dabo.ui.dEditor, id:-223)>
> This doesn't look like a button object  so what is it looking at?
> Is this suggesting underlying issues in my machine?


        No, not at all. It's suggesting that wxPython is not always consistent 
in how it does things.

        getMouseObject() is one of those 'magic' methods that doesn't work 100% 
of the time. One place I've seen issues is if you have multiple windows open 
and overlapping, getMouseObject() will sometimes return an object in one of the 
lower, covered windows. And under Windows (XP at least), if called from the 
Command Window, it causes the Command Window to disappear under the other open 
windows.

        Another trick that sometimes works is to make sure that the Command 
Window is to the right and below the window containing the object whose 
reference you are trying to get. I'm not sure why that works better sometimes; 
I've just discovered that by trial and error.



-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to