diff options
Diffstat (limited to 'lessons.py')
-rw-r--r-- | lessons.py | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -13,12 +13,14 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import os -import gtk +import gi +from gi.repository import Gtk +from gi.repository import Gdk import locale import logging from glob import glob -from sugar.activity.activity import get_bundle_path +from sugar3.activity.activity import get_bundle_path import theme @@ -36,37 +38,37 @@ class Lesson: def change(self): View.notebook.set_current_page(self.index) -class View(gtk.EventBox): +class View(Gtk.EventBox): notebook = None def __init__(self): - gtk.EventBox.__init__(self) + Gtk.EventBox.__init__(self) - View.notebook = gtk.Notebook() + View.notebook = Gtk.Notebook() View.notebook.props.show_border = False View.notebook.props.show_tabs = False self.add(View.notebook) for i in THEMES: - view = gtk.TextView() + view = Gtk.TextView() view.get_buffer().set_text(i.text) - view.set_wrap_mode(gtk.WRAP_WORD) + view.set_wrap_mode(Gtk.WrapMode.WORD) view.set_editable(False) - view_box = gtk.EventBox() + view_box = Gtk.EventBox() view_box.add(view) - view_box.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(theme.WHITE)) + view_box.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse(theme.WHITE)) view_box.props.border_width = 10 - border_box = gtk.EventBox() + border_box = Gtk.EventBox() border_box.add(view_box) - border_box.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(theme.WHITE)) + border_box.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse(theme.WHITE)) - scrolled_window = gtk.ScrolledWindow() - scrolled_window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) + scrolled_window = Gtk.ScrolledWindow() + scrolled_window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) scrolled_window.add_with_viewport(border_box) - View.notebook.append_page(scrolled_window) + View.notebook.append_page(scrolled_window, Gtk.Label('')) self.show_all() |