Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/linkbutton.py
diff options
context:
space:
mode:
authorManuel Quiñones <manuq@laptop.org>2011-11-25 02:00:52 (GMT)
committer Manuel Quiñones <manuq@laptop.org>2011-11-25 02:00:52 (GMT)
commitdec602fda0890bdbfb121107b9bb39f7954a9cd5 (patch)
treeb570a56bf29d76801347934ffa74feb2451de7e7 /linkbutton.py
parent6cd0ba03d5494b144a6c05dcc59f7ce9d39e6939 (diff)
Port from PyGTK to PyGI, renaming
Was done running the pygi-convert.sh script. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
Diffstat (limited to 'linkbutton.py')
-rw-r--r--linkbutton.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/linkbutton.py b/linkbutton.py
index 4a0a18f..49f6451 100644
--- a/linkbutton.py
+++ b/linkbutton.py
@@ -15,9 +15,9 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-import gtk
+from gi.repository import Gtk
import os
-import gobject
+from gi.repository import GObject
from gettext import gettext as _
import rsvg
import re
@@ -28,11 +28,11 @@ from sugar.graphics.tray import TrayButton
from sugar.graphics import style
-class LinkButton(TrayButton, gobject.GObject):
+class LinkButton(TrayButton, GObject.GObject):
__gtype_name__ = 'LinkButton'
__gsignals__ = {
- 'remove_link': (gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE, ([str])),
+ 'remove_link': (GObject.SignalFlags.RUN_FIRST,
+ None, ([str])),
}
def __init__(self, url, buf, color, title, owner, index, hash):
@@ -44,8 +44,8 @@ class LinkButton(TrayButton, gobject.GObject):
self.setup_rollover_options(info)
def set_image(self, buf, fill='#0000ff', stroke='#4d4c4f'):
- img = gtk.Image()
- loader = gtk.gdk.PixbufLoader()
+ img = Gtk.Image()
+ loader = GdkPixbuf.PixbufLoader()
loader.write(buf)
loader.close()
pixbuf = loader.get_pixbuf()
@@ -55,7 +55,7 @@ class LinkButton(TrayButton, gobject.GObject):
pixbuf_bg = self._read_link_background(xo_buddy, fill, stroke)
pixbuf_bg = pixbuf_bg.scale_simple(style.zoom(120),
style.zoom(110),
- gtk.gdk.INTERP_BILINEAR)
+ GdkPixbuf.InterpType.BILINEAR)
dest_x = style.zoom(10)
dest_y = style.zoom(20)
w = pixbuf.get_width()
@@ -64,7 +64,7 @@ class LinkButton(TrayButton, gobject.GObject):
scale_y = 1
pixbuf.composite(pixbuf_bg, dest_x, dest_y, w, h, dest_x, dest_y,
- scale_x, scale_y, gtk.gdk.INTERP_BILINEAR, 255)
+ scale_x, scale_y, GdkPixbuf.InterpType.BILINEAR, 255)
img.set_from_pixbuf(pixbuf_bg)
self.set_icon_widget(img)
img.show()
@@ -92,7 +92,7 @@ class LinkButton(TrayButton, gobject.GObject):
palette = Palette(info, text_maxlen=50)
self.set_palette(palette)
- menu_item = gtk.MenuItem(_('Remove'))
+ menu_item = Gtk.MenuItem(_('Remove'))
menu_item.connect('activate', self.item_remove_cb)
palette.menu.append(menu_item)
menu_item.show()