Johnny
Johnny

Reputation: 167

Grid of clickable images in wxPython

So I need to be able to open several images in a grid layout and click on the images to perform various actions. Right now I am adding the images to a grid sizer. How do I capture mouse events from a sizer? Or should I display the images in another way to make it easy to respond to mouse events?

Upvotes: 1

Views: 1421

Answers (1)

volting
volting

Reputation: 18967

Bind one of the mouse events to your images

eg.

your_staticBitmap_object.bind(wx.EVT_LEFT_UP, self.onImageClick, your_staticBitmap_object)

Upvotes: 3

Related Questions