At the moment, when a textview is a right click, a popup menu is returned, but the cursor is not actually Where there is a right click, make a change in that situation, it leaves the cursor alone for me, which is trying to implement the spell checking menu, this is not right because I want to get the cursor to the right place Click OK. So, my question is, is there any way to modify this behavior in any way, so that it really is in some way?
OK, I stumbled in gtk.TextView.get_iter_at_location, which I would like to do in gtk.TextView.get_pointer and gtk.TextView.window_to_buffer_coords Takes you on. Actually, to do this work, I did this: In fact, it receives the status of the indicator (relative to the window) It changes buffer coordinates (I know that gtk.TEXT_WINDOW_TEXT returns the same coordinates as gtk.TEXT_WINDOW_WIDGET, but I thought I would make a mistake in favor of caution and use the widget's window), and Then get a place at that location works wonderfully.
x, y = self.textView.get_pointer () x, y = self.textView.window_to_buffer_coords (gtk.texT_WINDOW_WIDGET, x, Y) If self.textView.get_iter_at_location (x, y) .has_tag (self.errTag): # code here
Comments
Post a Comment