blob: f97e45ab93b4621f271847df67f70793ddf1de3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
from gi.repository import Gtk
class Test(Gtk.Window):
def __init__(self):
super(Test, self).__init__()
self.connect("destroy", Gtk.main_quit)
vbox = Gtk.VBox()
self.entry = Gtk.Entry()
vbox.add(self.entry)
button1 = Gtk.Button('Get bounds')
button1.connect('clicked', self.__get_text_cb)
vbox.add(button1)
self.add(vbox)
self.show_all()
def __get_text_cb(self, button):
print self.entry.get_selection_bounds()
Test()
Gtk.main()
|