Mercurial > fife-parpg
comparison engine/python/fife/extensions/pychan/widgets/widget.py @ 431:f44b149f63e7
Added the ability to request focus via the pychan widget (added the requestFocus() function). Also fixed a problem where dialog boxes were not given focus when opened. fixes[t:465]
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Tue, 23 Feb 2010 19:44:36 +0000 |
parents | 64738befdf3b |
children | dc19d9e38880 |
comparison
equal
deleted
inserted
replaced
430:ad1f09d954f9 | 431:f44b149f63e7 |
---|---|
168 def _quitThisDialog(returnValue = returnValue ): | 168 def _quitThisDialog(returnValue = returnValue ): |
169 get_manager().breakFromMainLoop( returnValue ) | 169 get_manager().breakFromMainLoop( returnValue ) |
170 self.hide() | 170 self.hide() |
171 self.findChild(name=name).capture( _quitThisDialog , group_name = "__execute__" ) | 171 self.findChild(name=name).capture( _quitThisDialog , group_name = "__execute__" ) |
172 self.show() | 172 self.show() |
173 self.is_focusable = True | |
174 self.requestFocus() | |
173 return get_manager().mainLoop() | 175 return get_manager().mainLoop() |
176 | |
177 def requestFocus(self): | |
178 """ | |
179 Requests focus. | |
180 | |
181 The widget must be focusable in order for this to work. See | |
182 the is_focusable property. | |
183 | |
184 """ | |
185 | |
186 self.real_widget.requestFocus() | |
174 | 187 |
175 def match(self,**kwargs): | 188 def match(self,**kwargs): |
176 """ | 189 """ |
177 Matches the widget against a list of key-value pairs. | 190 Matches the widget against a list of key-value pairs. |
178 Only if all keys are attributes and their value is the same it returns True. | 191 Only if all keys are attributes and their value is the same it returns True. |