Ignore:
Timestamp:
07/04/19 17:57:45 (5 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Using 'Gtk' instead of 'gtk' (re #347)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/delaycodes.py

    r995 r996  
    1111#------------------------------------------------------------------------------
    1212
    13 class Viewport(gtk.Viewport):
     13class Viewport(Gtk.Viewport):
    1414    """Viewport implementation that alleviates the problem with improper
    1515    resizing by the VBox."""
    1616    def __init__(self):
    1717        """Construct the viewport."""
    18         gtk.Viewport.__init__(self)
     18        Gtk.Viewport.__init__(self)
    1919        self._recursive = False
    2020        self._vboxHeight = None
     
    3434            allocation.height = self._vboxHeight - allocation.y
    3535            self._vboxHeight = None
    36         gtk.Viewport.do_size_allocate(self, allocation)
    37 
    38 class DelayCodeTableBase(gtk.VBox, gtk.Scrollable):
     36        Gtk.Viewport.do_size_allocate(self, allocation)
     37
     38class DelayCodeTableBase(Gtk.VBox, Gtk.Scrollable):
    3939    """PyGObject-specific base class for the delay code table."""
    4040    __gproperties__ = {
    41         "vscroll-policy" : ( gtk.ScrollablePolicy,
     41        "vscroll-policy" : ( Gtk.ScrollablePolicy,
    4242                             "vscroll-policy",
    4343                             "The vertical scrolling policy",
    44                              gtk.ScrollablePolicy.MINIMUM,
     44                             Gtk.ScrollablePolicy.MINIMUM,
    4545                             GObject.PARAM_READWRITE ),
    46         "vadjustment" : ( gtk.Adjustment,
     46        "vadjustment" : ( Gtk.Adjustment,
    4747                          "vadjustment",
    4848                          "The vertical adjustment",
    4949                          GObject.PARAM_READWRITE ),
    50         "hscroll-policy" : ( gtk.ScrollablePolicy,
     50        "hscroll-policy" : ( Gtk.ScrollablePolicy,
    5151                             "hscroll-policy",
    5252                             "The horizontal scrolling policy",
    53                              gtk.ScrollablePolicy.MINIMUM,
     53                             Gtk.ScrollablePolicy.MINIMUM,
    5454                             GObject.PARAM_READWRITE ),
    55         "hadjustment" : ( gtk.Adjustment,
     55        "hadjustment" : ( Gtk.Adjustment,
    5656                          "hadjustment",
    5757                          "The horizontal adjustment",
     
    7474        do_size_allocate() function of VBox()."""
    7575        self._viewport.setVBOXHeight(allocation.height)
    76         gtk.VBox.do_size_allocate(self, allocation)
     76        Gtk.VBox.do_size_allocate(self, allocation)
    7777        self.allocate_column_sizes(allocation)
    7878
     
    109109        """Set the style of the event box from the treeview."""
    110110
    111 class Alignment(gtk.Alignment):
     111class Alignment(Gtk.Alignment):
    112112    """An alignment that remembers the width it was given."""
    113113    def __init__(self, xalign = 0.0, yalign=0.0,
     
    121121        """Called with the new size allocation."""
    122122        self.allocatedWidth = allocation.width
    123         gtk.Alignment.do_size_allocate(self, allocation)
    124 
    125 class TreeView(gtk.TreeView):
     123        Gtk.Alignment.do_size_allocate(self, allocation)
     124
     125class TreeView(Gtk.TreeView):
    126126    def do_size_allocate(self, allocation):
    127127        allocation.height += 1
    128         gtk.TreeView.do_size_allocate(self, allocation)
    129 
    130 #------------------------------------------------------------------------------
    131 
    132 class CheckButton(gtk.CheckButton):
     128        Gtk.TreeView.do_size_allocate(self, allocation)
     129
     130#------------------------------------------------------------------------------
     131
     132class CheckButton(Gtk.CheckButton):
    133133    """A check button that contains a reference to a row in the delay code
    134134    data table."""
     
    184184        self._delayCodeData = None
    185185
    186         self._treeView = TreeView(gtk.ListStore(str, str))
     186        self._treeView = TreeView(Gtk.ListStore(str, str))
    187187        self._treeView.set_rules_hint(True)
    188188
     
    192192        self._checkButtons = []
    193193
    194         self._eventBox = gtk.EventBox()
     194        self._eventBox = Gtk.EventBox()
    195195
    196196        self._table = None
     
    254254        numRows = len(rows)
    255255
    256         column = gtk.TreeViewColumn("", gtk.CellRendererText())
     256        column = Gtk.TreeViewColumn("", Gtk.CellRendererText())
    257257        column.set_sizing(TREE_VIEW_COLUMN_FIXED)
    258258        self._treeView.append_column(column)
    259259
    260260        for header in headers:
    261             column = gtk.TreeViewColumn(header, gtk.CellRendererText())
     261            column = Gtk.TreeViewColumn(header, Gtk.CellRendererText())
    262262            column.set_sizing(TREE_VIEW_COLUMN_FIXED)
    263263            self._treeView.append_column(column)
    264264
    265         self._table = gtk.Table(numRows, numColumns)
     265        self._table = Gtk.Table(numRows, numColumns)
    266266        self._table.set_homogeneous(False)
    267267        self._table.set_col_spacings(16)
     
    276276            (type, elements) = rows[i]
    277277            if type==CAPTION:
    278                 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     278                alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    279279                                          xscale = 1.0)
    280                 label = gtk.Label("<b>" + elements + "</b>")
     280                label = Gtk.Label("<b>" + elements + "</b>")
    281281                label.set_use_markup(True)
    282282                label.set_alignment(0.0, 0.5)
     
    297297
    298298                for j in range(0, numColumns-1):
    299                     label = gtk.Label(elements[j])
     299                    label = Gtk.Label(elements[j])
    300300                    label.set_alignment(0.0, 0.5)
    301301                    alignment = Alignment(xalign = 0.5, yalign = 0.5,
Note: See TracChangeset for help on using the changeset viewer.