Attachments you submit will be routed for moderation. If you have an account, please
log in first.
|
File test_icon.py, 500 bytes
(added by erikos, 7 months ago)
|
|
Simple test script that shows issue
|
| Line | |
|---|
| 1 | from gi.repository import Gtk |
|---|
| 2 | from gi.repository import GObject |
|---|
| 3 | |
|---|
| 4 | class Icon(Gtk.Image): |
|---|
| 5 | __gtype_name__ = 'SugarIcon' |
|---|
| 6 | |
|---|
| 7 | def __init__(self, **kwargs): |
|---|
| 8 | GObject.GObject.__init__(self, **kwargs) |
|---|
| 9 | self._file = None |
|---|
| 10 | |
|---|
| 11 | def get_file(self): |
|---|
| 12 | return self._file |
|---|
| 13 | |
|---|
| 14 | def set_file(self, file_name): |
|---|
| 15 | self._file = file_name |
|---|
| 16 | self._buffer.file_name = file_name |
|---|
| 17 | |
|---|
| 18 | file = GObject.property(type=object, setter=set_file, getter=get_file) |
|---|
| 19 | |
|---|
| 20 | icon = Icon() |
|---|
| 21 | icon.props.file |
|---|
| 22 | |
|---|
Download in other formats: