Detecting events (left double click) on a wx.StaticBitmap?

Howdy folks;
Just trying to figure out what is the proper event to bind to a bitmap
(if allowed) to detect a double click.

Barring that, the bitmap is in a scrolling window, which perhaps I'll
have to detect the event there, and somehow grab the target to know
which image was underneath the pointer?

I've studied wxP in Action and
http://wiki.wxpython.org/index.cgi/WorkingWithImages, along with
random google results, but am still a bit clueless when it comes to
divining what EVT's are appropriate to which widgets. =)

Thanks for any help.

···

--
-----------------------------
  e y e p u l p
-----------------------------

Ask, and Google shall answer:

bmp.Bind(wx.EVT_LEFT_DOWN, self.onAttachmentClick)

That will do the trick for now - I'll keep looking for the (no doubt
very simple) double click version. Sorry for the unneeded post.

···

On 1/17/07, EyePulp <eyepulp@eyepulp.net> wrote:

Howdy folks;
Just trying to figure out what is the proper event to bind to a bitmap
(if allowed) to detect a double click.

Barring that, the bitmap is in a scrolling window, which perhaps I'll
have to detect the event there, and somehow grab the target to know
which image was underneath the pointer?

I've studied wxP in Action and
http://wiki.wxpython.org/index.cgi/WorkingWithImages, along with
random google results, but am still a bit clueless when it comes to
divining what EVT's are appropriate to which widgets. =)

Thanks for any help.

--
-----------------------------
  e y e p u l p
-----------------------------

> Just trying to figure out what is the proper event to bind to a bitmap
> (if allowed) to detect a double click.

The docs for wxMouseEvents have a list of event types that you can bind to:
http://wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseevent

EVT_LEFT_DCLICK sounds like what you're looking for.

bmp.Bind(wx.EVT_LEFT_DOWN, self.onAttachmentClick)

It looks like you stumbled upon an answer for where to .Bind to--you'll find
that there are several ways to go about handling events, but one of the easiest
is to forget generating event IDs and just Bind on the controls you'd like to
receive events from.

Don't forget things like "dir(wx.MouseEvent)" in a Python console too for a
quick way of discovering methods and their functionality.

EyePulp wrote:

bmp.Bind(wx.EVT_LEFT_DOWN, self.onAttachmentClick)

EVT_LEFT_DCLICK

NOTE: look for wxMouseEvent in the wx docs:

http://www.wxpython.org/onlinedocs.php

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

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

Thanks all for the references - nothing humbles you like having to
figure out the most basic of events (i.e. a double click) in a new gui
platform.

···

On 1/17/07, Christopher Barker <Chris.Barker@noaa.gov> wrote:

EyePulp wrote:

> bmp.Bind(wx.EVT_LEFT_DOWN, self.onAttachmentClick)

EVT_LEFT_DCLICK

NOTE: look for wxMouseEvent in the wx docs:

http://www.wxpython.org/onlinedocs.php

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

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

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

--
-----------------------------
  e y e p u l p
-----------------------------