Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/StoryBuilder.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-01-17 15:24:06 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-01-17 15:24:06 (GMT)
commitb3b07e8904753548364321ba770761f881cda0eb (patch)
tree810bfa57646c79f8cdae0614f0529e093fac8cec /StoryBuilder.py
parent2e443163dd42fedae2dc81e14e21e4b5ca4aa795 (diff)
suppress pgu's odd behaviour - resize text box after show/hide lessons area
Diffstat (limited to 'StoryBuilder.py')
-rw-r--r--StoryBuilder.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/StoryBuilder.py b/StoryBuilder.py
index c6d8bc7..76b2473 100644
--- a/StoryBuilder.py
+++ b/StoryBuilder.py
@@ -51,7 +51,7 @@ CLEAR = pygame.rect.Rect((932, 435, 46, 33))
SOUND = pygame.rect.Rect((932, 114, 46, 33))
THEME_LEFT = pygame.rect.Rect((410, 506, 46, 33))
THEME_RIGHT = pygame.rect.Rect((567, 506, 46, 33))
-TEXTAREA = pygame.rect.Rect((62, 595, 887, 97))
+TEXTAREA = pygame.rect.Rect((62, 560, 875, 114))
def load_image(name, (x, y)=(None, None)):
"""Load an image from a specific file.
@@ -329,10 +329,12 @@ class Game:
self.lesson_plan_texts = []
self.lesson_plan_area = None
- text_input = gui.TextArea(value=self.text, width=875, height=95)
+ TEXTAREA.x += self.layout.rect.left
+ TEXTAREA.y += self.layout.rect.top
+ text_input = gui.TextArea(value=self.text)
+ text_input.rect = pygame.rect.Rect(TEXTAREA)
text_input.connect(gui.CHANGE, self.update_text_cb)
- guicontainer.add(text_input, 62+self.layout.rect.left,
- 560+self.layout.rect.top)
+ guicontainer.add(text_input, text_input.rect.x, text_input.rect.y)
self.text_input = text_input
self.guicontainer = guicontainer
@@ -406,6 +408,8 @@ class Game:
else:
self.lesson_plan_show(self.lesson_plan_texts[0])
+ self.text_input.rect = pygame.rect.Rect(TEXTAREA)
+
def lesson_plan_show(self, lesson_to_show):
self.lesson_plan_area = gui.Container(
width=self.background.rect.width,
@@ -445,6 +449,7 @@ class Game:
lesson = self.lesson_plan_group.value
self.lesson_plan_hide()
self.lesson_plan_show(lesson)
+ self.text_input.rect = pygame.rect.Rect(TEXTAREA)
def show_file_dialog(self):
file_dialog = gui.dialog.FileDialog(self)