1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 from fife.extensions import pychan
19
21 """Create a popup for when you click examine on an object"""
23 """Initialize the popup
24 @type engine: fife.Engine
25 @param engine: an instance of the fife engine
26 @type object_title: string
27 @param object_title: The title for the window, probably should just
28 be the name of the object
29 @type desc: string
30 @param desc: The description of the object
31 @return: None"""
32 self.engine = engine
33
34 self.examine_window = pychan.widgets.\
35 Window(title=unicode(object_title),
36 position_technique="center:center",
37 min_size=(175,175))
38
39 self.scroll = pychan.widgets.ScrollArea(name='scroll', size=(150,150))
40 self.description = pychan.widgets.Label(name='descText',
41 text=unicode(desc),
42 wrap_text=True)
43 self.description.max_width = 170
44 self.scroll.addChild(self.description)
45 self.examine_window.addChild(self.scroll)
46
47 self.close_button = pychan.widgets.Button(name='closeButton',
48 text=unicode('Close'))
49 self.examine_window.addChild(self.close_button)
50
51 self.examine_window.mapEvents({'closeButton':self.examine_window.hide})
52
54
55 if self.examine_window.isVisible():
56 self.examine_window.hide()
57
59
60 self.examine_window.show()
61