]> git.datanom.net - lensdatabase.git/blame_incremental - textview.py
update .gitignore and add setup tools
[lensdatabase.git] / textview.py
... / ...
CommitLineData
1import gi
2gi.require_version("Gtk", "3.0")
3from gi.repository import Gtk
4
5class Textview:
6 def __init__(self):
7 self.scrolledWindow = Gtk.ScrolledWindow()
8 self.scrolledWindow.set_hexpand(True)
9 self.scrolledWindow.set_vexpand(True)
10 self.textview = Gtk.TextView()
11 self.textview.set_wrap_mode(Gtk.WrapMode.WORD)
12 self.scrolledWindow.add(self.textview)
13
14 def getScrolledWindow(self):
15 return self.scrolledWindow
16
17 def getTextview(self):
18 return self.textview
19
20 def getText(self):
21 textbuffer = self.textview.get_buffer()
22 start = textbuffer.get_start_iter()
23 end = textbuffer.get_end_iter()
24 return textbuffer.get_text(start, end, False)
25
26 def setText(self, text):
27 textbuffer = self.textview.get_buffer()
28 textbuffer.set_text(text)
This page took 0.029894 seconds and 6 git commands to generate.