fix kivycatalog

This commit is contained in:
Mathieu Virbel 2013-03-31 11:59:37 +02:00
parent c41be5d3f6
commit fe788691d9
2 changed files with 10 additions and 3 deletions

View File

@ -7,6 +7,14 @@
on_press: root.parent.parent.parent.show_kv(*args) on_press: root.parent.parent.parent.show_kv(*args)
state: ctx.state if hasattr(ctx, "state") else "normal" state: ctx.state if hasattr(ctx, "state") else "normal"
<Container>:
canvas.before:
Color:
rgb: 0, 0, 0
Rectangle:
pos: self.pos
size: self.size
<Catalog>: <Catalog>:
language_box: language_box language_box: language_box
screen_manager: screen_manager screen_manager: screen_manager

View File

@ -115,8 +115,7 @@ class Catalog(BoxLayout):
self.screen_manager.current = object.text self.screen_manager.current = object.text
with open(self.screen_manager.current_screen.content.children[ with open(self.screen_manager.current_screen.children[0].kv_file) as file:
0].kv_file) as file:
self.language_box.text = file.read() self.language_box.text = file.read()
# reset undo/redo history # reset undo/redo history
self.language_box.reset_undo() self.language_box.reset_undo()
@ -132,7 +131,7 @@ class Catalog(BoxLayout):
on the kv file the user entered. If there is an error in their kv on the kv file the user entered. If there is an error in their kv
syntax, show a nice popup.''' syntax, show a nice popup.'''
kv_container = self.screen_manager.current_screen.content.children[0] kv_container = self.screen_manager.current_screen.children[0]
try: try:
parser = Parser(content=self.language_box.text.encode('utf8')) parser = Parser(content=self.language_box.text.encode('utf8'))
kv_container.clear_widgets() kv_container.clear_widgets()