开发者

wxPython: Highlight item in GidSizer upon mouse click

开发者 https://www.devze.com 2023-01-10 20:20 出处:网络
I have a Panel with a bunch of pictures placed on it in a GridSizer layout. How can I draw a highlighted color around the edge of an image or开发者_运维百科 its border to show that it has been selecte

I have a Panel with a bunch of pictures placed on it in a GridSizer layout. How can I draw a highlighted color around the edge of an image or开发者_运维百科 its border to show that it has been selected upon a mouse click event?


Take a look at the Widget Inspection Tool's code. It can highlight any widget. On my machine, it's in the "_InspectionHighlighter" class in the inspection.py file, which is here: C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\lib

You can read about the tool here: http://wiki.wxpython.org/Widget%20Inspection%20Tool


You could put each picture in a panel, and use SetBackgroundColour()to set the background color of the panel.

0

精彩评论

暂无评论...
验证码 换一张
取 消