开发者

Change the events for different parts of the same widget

I have created a margin in a gtk.TextView widget. Now I want to make sure that the default event handler for mouse click, which is开发者_如何学编程 moving the text cursor to the clicked position, works only when clicked to the right of the margin.

Is this possible?


Try connecting to the button-press-event but doing it before the widget's own connection. If you connect after the view does it, this will be the default (GObject signal handlers are handled in reverse order of connection by default). Then determine if the event should be let through or not, by returning TRUE (to stop the event) or FALSE as required.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜