Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/helpbutton.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-10-29 12:42:09 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-10-29 12:42:09 (GMT)
commit94cee3bdd2db050345f042658bdb99097402e7f1 (patch)
treee954e49ad8667d8cf0580d965f456b2a4d37cfe6 /helpbutton.py
parent63fd576111cc9946d718c9accbc654214540a1cb (diff)
parentb1cd00c563c82cdb8a075435e2aa640be4f0dfaa (diff)
Merge git.sugarlabs.org:~walter/visualmatch/walter-gtk3v43
Diffstat (limited to 'helpbutton.py')
-rw-r--r--helpbutton.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/helpbutton.py b/helpbutton.py
index 6c4540b..cea6110 100644
--- a/helpbutton.py
+++ b/helpbutton.py
@@ -21,11 +21,12 @@
from gettext import gettext as _
-import gtk
+from gi.repository import Gtk
+from gi.repository import Gdk
-from sugar.graphics.toolbutton import ToolButton
-from sugar.graphics.icon import Icon
-from sugar.graphics import style
+from sugar3.graphics.toolbutton import ToolButton
+from sugar3.graphics.icon import Icon
+from sugar3.graphics import style
help_windows = {}
help_buttons = {}
@@ -34,13 +35,13 @@ import logging
_logger = logging.getLogger('visualmatch-activity')
-class HelpButton(gtk.ToolItem):
+class HelpButton(Gtk.ToolItem):
def __init__(self, activity):
self._activity = activity
self._current_palette = 'game'
- gtk.ToolItem.__init__(self)
+ Gtk.ToolItem.__init__(self)
help_button = ToolButton('help-toolbar')
help_button.set_tooltip(_('Help'))
@@ -85,9 +86,9 @@ class HelpButton(gtk.ToolItem):
def add_section(help_box, section_text, icon=None):
''' Add a section to the help palette. From helpbutton.py by
Gonzalo Odiard '''
- max_text_width = int(gtk.gdk.screen_width() / 3) - 20
- hbox = gtk.HBox()
- label = gtk.Label()
+ max_text_width = int(Gdk.Screen.width() / 3) - 20
+ hbox = Gtk.HBox()
+ label = Gtk.Label()
label.set_use_markup(True)
label.set_markup('<b>%s</b>' % section_text)
label.set_line_wrap(True)
@@ -107,10 +108,10 @@ def add_section(help_box, section_text, icon=None):
def add_paragraph(help_box, text, icon=None):
''' Add an entry to the help palette. From helpbutton.py by
Gonzalo Odiard '''
- max_text_width = int(gtk.gdk.screen_width() / 3) - 20
- hbox = gtk.HBox()
- label = gtk.Label(text)
- label.set_justify(gtk.JUSTIFY_LEFT)
+ max_text_width = int(Gdk.Screen.width() / 3) - 20
+ hbox = Gtk.HBox()
+ label = Gtk.Label(label=text)
+ label.set_justify(Gtk.Justification.LEFT)
label.set_line_wrap(True)
hbox.add(label)
if icon is not None: