~vcs-imports/pythoncad/main

« back to all changes in this revision

Viewing changes to PythonCAD/Interface/Gtk/gtkentities.py

  • Committer: arth
  • Date: 2007-06-14 22:19:07 UTC
  • Revision ID: vcs-imports@canonical.com-20070614221907-oaldbghroodrb1x1

PythonCAD/Interface/Gtk/gtkentities.py: Use getUnits() and setUnits() to
get/set the Image units. Using [gs]etOption('UNITS') is likely to be
deprecated shortly ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
1558
1558
                         (gtk.STOCK_OK, gtk.RESPONSE_OK,
1559
1559
                          gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
1560
1560
    _image = gtkimage.getImage()
1561
 
    _unit = _image.getOption('UNITS')
 
1561
    _unit = _image.getUnits()
1562
1562
    _idx = 0
1563
1563
    if hasattr(gtk, 'ComboBox'): # PyGTK 2.4
1564
1564
        _widget = gtk.combo_box_new_text()
1598
1598
            raise TypeError, "Unexpected widget " + `type(_widget)`
1599
1599
        _val = units.Unit.getUnitFromString(_units[_idx])
1600
1600
        if _val != _unit:
1601
 
            _image.setOption('UNITS', _val)
 
1601
            _image.setUnits(_val)
1602
1602
    _dialog.destroy()