zenofpython
zenofpython

Reputation: 184

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?

Upvotes: 0

Views: 152

Answers (1)

Mike Driscoll
Mike Driscoll

Reputation: 33111

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:

Upvotes: 1

Related Questions