diff options
author | Seth Hitefield <sdhitefield@gmail.com> | 2016-04-11 22:09:16 -0400 |
---|---|---|
committer | Seth Hitefield <sdhitefield@gmail.com> | 2016-05-24 11:11:33 -0400 |
commit | e66cfa31ff52b95a9c3df27c8a1f3b02bef6db3d (patch) | |
tree | e6b38580dfe554f83a92a24f9b0224d462b4ad97 /grc/gui/Block.py | |
parent | c73ee1053f27bdae00b9cdeb12cabfab37854425 (diff) |
grc: Main window opens with pygobject and gtk3. Still throws tons of errors.
Diffstat (limited to 'grc/gui/Block.py')
-rw-r--r-- | grc/gui/Block.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/grc/gui/Block.py b/grc/gui/Block.py index a0a5f26fd4..64c9e022b5 100644 --- a/grc/gui/Block.py +++ b/grc/gui/Block.py @@ -17,10 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ -import pygtk -pygtk.require('2.0') -import gtk -import pango +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk +from gi.repository import Pango from . import Actions, Colors, Utils @@ -202,7 +202,7 @@ class Block(Element, _Block): layouts = list() #create the main layout - layout = gtk.DrawingArea().create_pango_layout('') + layout = Gtk.DrawingArea().create_pango_layout('') layouts.append(layout) layout.set_markup(Utils.parse_template(BLOCK_MARKUP_TMPL, block=self, font=BLOCK_FONT)) self.label_width, self.label_height = layout.get_pixel_size() @@ -214,8 +214,8 @@ class Block(Element, _Block): else: markups = [param.get_markup() for param in self.get_params() if param.get_hide() not in ('all', 'part')] if markups: - layout = gtk.DrawingArea().create_pango_layout('') - layout.set_spacing(LABEL_SEPARATION*pango.SCALE) + layout = Gtk.DrawingArea().create_pango_layout('') + layout.set_spacing(LABEL_SEPARATION*Pango.SCALE) layout.set_markup('\n'.join(markups)) layouts.append(layout) w, h = layout.get_pixel_size() @@ -279,7 +279,7 @@ class Block(Element, _Block): complexity = calculate_flowgraph_complexity(self.get_parent()) complexity = "Complexity: {}bal".format(num_to_str(complexity)) - layout = gtk.DrawingArea().create_pango_layout('') + layout = Gtk.DrawingArea().create_pango_layout('') layout.set_markup(Utils.parse_template(COMMENT_COMPLEXITY_MARKUP_TMPL, block=self, comment=comment, |