开发者

Change the events for different parts of the same widget

开发者 https://www.devze.com 2022-12-15 18:31 出处:网络
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, work

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

精彩评论

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