Fw: Need your help about wxpython

Hi Guys,

I am writting for my doubt about wx.PopupTransientWindow .

You wrote as follows,

class TestTransientPopup(wx.PopupTransientWindow):

“”“Adds a bit of text and mouse movement to the wx.PopupWindow”""

def init(self, parent, style, log):

wx.PopupTransientWindow.init(self, parent, style)

self.log = log

self.SetBackgroundColour("#FFB6C1")

st = wx.StaticText(self, -1,

“wx.PopupTransientWindow is a\n”

“wx.PopupWindow which disappears\n”

“automatically when the user\n”

“clicks the mouse outside it or if it\n”

“(or its first child) loses focus in \n”

“any other way.”

···

,

pos=(10,10))

sz = st.GetBestSize()

self.SetSize( (sz.width+20, sz.height+20) )

def ProcessLeftDown(self, evt):

self.log.write(“ProcessLeftDown\n”)

return False

def OnDismiss(self):

self.log.write(“OnDismiss\n”)

There are no bind function in this class, how does ProcessLeftDown function work?

I am sure there are some bind() function called in PopupTransiendtWindow, but I can not find any document about it.

Could you please tell where can I get the document about the eventhandles list? Thanks a lot!

Such as, if I want deal with the right mouse button down , is it “def ProcessRightDown()”? Where are these functions documents?

Best wishes,

Feng Xuanshuo

2009-06-16

usr.root


usr.root wrote:

Hi Guys,

I am writting for my doubt about wx.PopupTransientWindow .

You wrote as follows,

There are no bind function in this class, how does ProcessLeftDown
function work?

It is a C++ "virtual method" that is reflected into the Python code when
it is called. Another term for it would be an automatic callback.

I am sure there are some bind() function called in
PopupTransiendtWindow, but I can not find any document about it.

Could you please tell where can I get the document about the
eventhandles list? Thanks a lot!

Such as, if I want deal with the right mouse button down , is it "def
ProcessRightDown()"?

No, go ahead and use normal event handling for any other events. The
ProcessLeftDown exists because the wx.PopupTransientWindow needs that
event for itself in order to function correctly, but it also gives your
class a chance to be notified about it by providing the callback.

···

--
Robin Dunn
Software Craftsman