diff options
Diffstat (limited to 'infoslicer/widgets/Textbox.py')
-rw-r--r-- | infoslicer/widgets/Textbox.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/infoslicer/widgets/Textbox.py b/infoslicer/widgets/Textbox.py index 0e586ad..95f0681 100644 --- a/infoslicer/widgets/Textbox.py +++ b/infoslicer/widgets/Textbox.py @@ -1,14 +1,13 @@ # Copyright (C) IBM Corporation 2008
-import gi
-gi.require_version('Gtk', '3.0')
-from gi.repository import Gtk
-from gi.repository import GObject
-from gi.repository import Pango
+import pygtk
+pygtk.require('2.0')
+import gtk
import cPickle
+import pango
SELECT_SENTENCE, SELECT_PARAGRAPH, SELECT_SECTION, FULL_EDIT = range(4)
-class Textbox( Gtk.TextView ):
+class Textbox( gtk.TextView ):
"""
Created by Jonathan Mace
The Textbox class is the base class for our own custom textboxes which implement
@@ -20,13 +19,13 @@ class Textbox( Gtk.TextView ): def __init__(self):
- GObject.GObject.__init__(self)
+ gtk.TextView.__init__(self)
self.set_border_width(1)
self.event_handlers = []
- self.set_wrap_mode(Gtk.WrapMode.WORD)
+ self.set_wrap_mode(gtk.WRAP_WORD)
self.set_cursor_visible(False)
self.set_editable(False)
- self.modify_font(Pango.FontDescription('arial 9'))
+ self.modify_font(pango.FontDescription('arial 9'))
self.article = None
self.set_property("left-margin", 5)
@@ -38,7 +37,7 @@ class Textbox( Gtk.TextView ): return self.article
def show(self):
- Gtk.TextView.show(self)
+ gtk.TextView.show(self)
def clear(self):
self.article.delete()
@@ -52,6 +51,6 @@ class Textbox( Gtk.TextView ): def get_mouse_iter(self, x, y):
# Convenience method to get the iter in the buffer of x, y coords.
- click_coords = self.window_to_buffer_coords(Gtk.TextWindowType.TEXT, x, y)
+ click_coords = self.window_to_buffer_coords(gtk.TEXT_WINDOW_TEXT, x, y)
mouseClickPositionIter = self.get_iter_at_location(click_coords[0], click_coords[1])
- return mouseClickPositionIter
+ return mouseClickPositionIter
\ No newline at end of file |