Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/port/roundbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'port/roundbox.py')
-rw-r--r--port/roundbox.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/port/roundbox.py b/port/roundbox.py
index 54ae1a9..ab0f81e 100644
--- a/port/roundbox.py
+++ b/port/roundbox.py
@@ -1,15 +1,15 @@
import math
-import gtk
-from sugar.graphics import style
+from gi.repository import Gtk
+from sugar3.graphics import style
-class RoundBox(gtk.HBox):
+class RoundBox(Gtk.HBox):
__gtype_name__ = 'RoundBox'
_BORDER_DEFAULT = style.LINE_WIDTH
def __init__(self, **kwargs):
- gtk.HBox.__init__(self, **kwargs)
+ Gtk.HBox.__init__(self, **kwargs)
self._radius = style.zoom(10)
self.border = self._BORDER_DEFAULT
@@ -61,20 +61,20 @@ class RoundBox(gtk.HBox):
if __name__ == '__main__':
- win = gtk.Window()
- win.connect('destroy', gtk.main_quit)
+ win = Gtk.Window()
+ win.connect('destroy', Gtk.main_quit)
win.set_default_size(450, 550)
- vbox = gtk.VBox()
+ vbox = Gtk.VBox()
box1 = RoundBox()
vbox.add(box1)
- label1 = gtk.Label("Test 1")
+ label1 = Gtk.Label("Test 1")
box1.add(label1)
rbox = RoundBox()
rbox.background_color = style.Color('#FF0000')
vbox.add(rbox)
- label2 = gtk.Label("Test 2")
+ label2 = Gtk.Label("Test 2")
rbox.add(label2)
bbox = RoundBox()
@@ -84,4 +84,4 @@ if __name__ == '__main__':
win.add(vbox)
win.show_all()
- gtk.main()
+ Gtk.main()