Mercurial > fife-parpg
diff engine/extensions/pychan/__init__.py @ 205:54bfd1015b35
* PyChan event handling rework (part I)
** Unified listeners
** ...hopefully more robust attach/detach code.
* Added compat, layout and also the new autopsition feature.
* Documentation
* Minor style fixes in core.
author | phoku@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 14 Mar 2009 12:13:29 +0000 |
parents | 06dddc96ce54 |
children | b0c4e6e41659 |
line wrap: on
line diff
--- a/engine/extensions/pychan/__init__.py Sat Mar 14 12:03:56 2009 +0000 +++ b/engine/extensions/pychan/__init__.py Sat Mar 14 12:13:29 2009 +0000 @@ -10,7 +10,7 @@ -------- - Simpler Interface - Very Basic XML Format support - - Very Basic Layout Engine + - Basic Layout Engine - Pseudo-Synchronous Dialogs. - Automagic background tiling (WIP) - Basic Styling support. @@ -24,8 +24,6 @@ - Documentation ( Allways not enough :-( ) - Handle Image Fonts - Move Font config files to XML, too ... - - Add support for fixed size 'Spacers' - - Add messageBox(text) - Implement real Menus - Implement StackWidget @@ -37,9 +35,9 @@ BUGS ---- - Focus problems with Widget.execute. - - Layout Bugs where max_size of a parent widget get's ignored. - Font.glyph_spacing is rendered incorrectly. - - It just looks ugly. + - Is this a bug? At least inconvenient. MouseEntered events are not distributed for freshly shown widget. + - It just looks bad. Problems -------- @@ -154,6 +152,8 @@ } } +A new style is added to pychan with L{internal.Manager.addStyle}. + The font is set via a string identifier pulled from a font definition in a PyChan configuration file. You have to load these by calling L{loadFonts} in your startup code:: @@ -225,8 +225,6 @@ 'manager' ] -import fife, pythonize - from widgets import * from exceptions import * @@ -244,9 +242,11 @@ @param engine: The FIFE engine object. """ - from manager import Manager + from compat import _munge_engine_hook + from internal import Manager global manager - manager = Manager(engine,debug) + + manager = Manager(_munge_engine_hook(engine),debug) # XML Loader @@ -326,6 +326,9 @@ def _createSpacer(self,cls,name,attrs): obj = cls(parent=self.root) + for k,v in attrs.items(): + self._setAttr(obj,k,v) + if hasattr(self.root,'add'): self.root.addSpacer(obj) else: