Mercurial > fife-parpg
comparison clients/pychan_demo/styling.py @ 125:97d6946bd917
- prepared files for new dir structure
author | chewie@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Wed, 06 Aug 2008 22:24:57 +0000 |
parents | 4a0efb7baf70 |
children | f98443afed5b |
comparison
equal
deleted
inserted
replaced
124:d5658e6c34f5 | 125:97d6946bd917 |
---|---|
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 class StylingExample(PyChanExample): | 86 class StylingExample(PyChanExample): |
87 def __init__(self): | 87 def __init__(self): |
88 super(StylingExample,self).__init__('content/gui/styling.xml') | 88 super(StylingExample,self).__init__('gui/styling.xml') |
89 | 89 |
90 self.styles = ['default'] + STYLES.keys() | 90 self.styles = ['default'] + STYLES.keys() |
91 for name,style in STYLES.items(): | 91 for name,style in STYLES.items(): |
92 pychan.manager.addStyle(name,style) | 92 pychan.manager.addStyle(name,style) |
93 | 93 |
94 pychan.loadFonts("content/fonts/samanata.fontdef") | 94 pychan.loadFonts("fonts/samanata.fontdef") |
95 | 95 |
96 def start(self): | 96 def start(self): |
97 self.styledCredits = None | 97 self.styledCredits = None |
98 self.widget = pychan.loadXML(self.xmlFile) | 98 self.widget = pychan.loadXML(self.xmlFile) |
99 self.widget.mapEvents({ | 99 self.widget.mapEvents({ |
112 | 112 |
113 def testStyle(self): | 113 def testStyle(self): |
114 style = self.styles[self.widget.collectData('styleList')] | 114 style = self.styles[self.widget.collectData('styleList')] |
115 if self.styledCredits: | 115 if self.styledCredits: |
116 self.styledCredits.hide() | 116 self.styledCredits.hide() |
117 self.styledCredits = pychan.loadXML('content/gui/all_widgets.xml') | 117 self.styledCredits = pychan.loadXML('gui/all_widgets.xml') |
118 self.styledCredits.distributeInitialData({ | 118 self.styledCredits.distributeInitialData({ |
119 'demoList' : dir(pychan), | 119 'demoList' : dir(pychan), |
120 'demoText' : pychan.__doc__ | 120 'demoText' : pychan.__doc__ |
121 }) | 121 }) |
122 self.styledCredits.stylize(style) | 122 self.styledCredits.stylize(style) |