简体   繁体   中英

Text event in wxpython

I am having trouble in wxpython. I would like to know how to produce text on a dialog that looks like static text but when you click on it, it runs an event. Does anybody have any idea how I could do such a thing?

I would use the mouse click events, like wx.EVT_LEFT_DOWN or wx.EVT_LEFT_UP along with the static text widget's HitTest method. So in your mouse event handler, you would want to call HitTest and use it to determine if you clicked within the static widget. See the following documentation for additional information:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM