Catching a mouse click on a mediactrl?

I'm wondering if anyone knows of a way to detect if someone has clicked on a wx.media.MediaCtrl? Is there a way to bind EVT_LEFT_DOWN or something similar?

I can't figure out a way.

Alec Bennett wrote:

I'm wondering if anyone knows of a way to detect if someone has clicked on a wx.media.MediaCtrl? Is there a way to bind EVT_LEFT_DOWN or something similar?

Depending on platform and maybe also on which backend is used the media ctrl may be using a child window as part of its implementation. If that window has the focus then the key events will be going to it, not the media ctrl. Something like this might work:

  for child in mc.GetChildren():
    child.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown())
  mc.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown())

ยทยทยท

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