Mercurial > rinkhals
comparison gamelib/misc.py @ 519:f84ad10a9625
Remove move tool. Add basic controls reference dialog
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Fri, 27 Nov 2009 13:55:07 +0000 |
parents | 96dbf2c8506e |
children | d16ed2a8a33e |
comparison
equal
deleted
inserted
replaced
518:a42852e50df1 | 519:f84ad10a9625 |
---|---|
113 def check_exit(): | 113 def check_exit(): |
114 dialog = CheckDialog() | 114 dialog = CheckDialog() |
115 dialog.open() | 115 dialog.open() |
116 return dialog | 116 return dialog |
117 | 117 |
118 # Utility layout functions | |
118 | 119 |
120 def make_box(text): | |
121 style = { | |
122 'border' : 1 | |
123 } | |
124 word = gui.Label(text, style=style) | |
125 return word | |
126 | |
127 def fix_widths(doc): | |
128 """Loop through all the widgets in the doc, and set the | |
129 width of the labels to max + 10""" | |
130 # We need to do this because of possible font issues | |
131 max_width = 0 | |
132 for thing in doc.widgets: | |
133 if hasattr(thing, 'style'): | |
134 # A label | |
135 if thing.style.width > max_width: | |
136 max_width = thing.style.width | |
137 for thing in doc.widgets: | |
138 if hasattr(thing, 'style'): | |
139 thing.style.width = max_width + 10 | |
140 |