我正在尝试在 enaml 文件中使用 id,当我运行程序时
enaml-run hello_world.enaml
我得到这个输出
File "hello_world.enaml", line 10
id: pb1
SyntaxError: invalid syntax
输出总是在 id 上产生无效的语法错误。我如何正确识别身份?
资源:
from enaml.layout.api import vbox, hbox, spacer, align
from enaml.widgets.api import (Window, Container, GroupBox, Form, PushButton,
CheckBox, RadioButton, Label, ScrollArea, ToolBar, Action, ActionGroup,
Splitter, Field)
enamldef Left(Container):
GroupBox:
title="Consoles"
PushButton:
id: pb1
text="hello"
enamldef Right(Container):
Label:
text="Yo"
enamldef Bottom(ToolBar):
PushButton:
Field:
text="Search..."
enamldef Main(Window):
title="RetroArch"
initial_size = (800,600)
Container:
Splitter:
Left:lt:
pass
Right:rt:
pass
Bottom:
pass