1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 from common import *
25 from widget import Widget
26 from fife.extensions.pychan.properties import ImageProperty
27
29 """
30 An image icon.
31
32 New Attributes
33 ==============
34
35 - image: String or GuiImage: The source location of the Image or a direct GuiImage
36 """
37 ATTRIBUTES = Widget.ATTRIBUTES + [ Attr('image') ]
38
39 - def __init__(self,
40 parent = None,
41 name = None,
42 size = None,
43 min_size = None,
44 max_size = None,
45 helptext = None,
46 position = None,
47 style = None,
48 hexpand = None,
49 vexpand = None,
50 font = None,
51 base_color = None,
52 background_color = None,
53 foreground_color = None,
54 selection_color = None,
55 border_size = None,
56 position_technique = None,
57 is_focusable = None,
58 comment = None,
59 image = None):
60
61 self.real_widget = fife.Icon(None)
62 super(Icon,self).__init__(parent=parent,
63 name=name,
64 size=size,
65 min_size=min_size,
66 max_size=max_size,
67 helptext=helptext,
68 position=position,
69 style=style,
70 hexpand=hexpand,
71 vexpand=vexpand,
72 font=font,
73 base_color=base_color,
74 background_color=background_color,
75 foreground_color=foreground_color,
76 selection_color=selection_color,
77 border_size=border_size,
78 position_technique=position_technique,
79 is_focusable=is_focusable,
80 comment=comment)
81 self.image = image
82
84 iconClone = Icon(None,
85 self._createNameWithPrefix(prefix),
86 self.size,
87 self.min_size,
88 self.max_size,
89 self.helptext,
90 self.position,
91 self.style,
92 self.hexpand,
93 self.vexpand,
94 self.font,
95 self.base_color,
96 self.background_color,
97 self.foreground_color,
98 self.selection_color,
99 self.border_size,
100 self.position_technique,
101 self.is_focusable,
102 self.comment,
103 self.image)
104
105
106 return iconClone
107
108 _image = ImageProperty("Image")
109
112
115 image = property(_getImage,_setImage)
116