2

I am trying to use id's in an enaml file and when I run the program with

enaml-run hello_world.enaml 

I get this output

File "hello_world.enaml", line 10
    id: pb1
SyntaxError: invalid syntax

The output always produces an invalid syntax error on the id. How do I properly identity id's?

Source:

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
user2887117
  • 203
  • 2
  • 12
  • Welcome to Stack Overflow! Unlike other online forums you may have used, Stack Overflow is **question**-and-**answer** site. It is not a discussion forum or a coding service. Users, such as yourself, ask *questions*, and other users provide answers. Do you have a specific question? – Robᵩ Oct 16 '13 at 16:37
  • Yes, I am trying to find out what I did incorrectly and how to use the id's in enaml properly. – user2887117 Oct 16 '13 at 18:38

2 Answers2

3

The 'id' tag was deprecated in version 0.7.0 and fully removed in version 0.8.0. The proper way to declare identifiers is inline after the element type like so:

PushButton: pb1:
    pass

The repo for Enaml moved with version 0.7.0 to here: https://github.com/nucleic/enaml

and the most current version of the docs are now here: http://nucleic.github.io/enaml/docs/

The docs (like the framework) are still a work in progress.

If you run into any more trouble, feel free to open an issue on the tracker (until I setup a proper list).

Source: I'm the author of Enaml

Chris Colbert
  • 868
  • 7
  • 12
1

This is a comment, but I'm posting it as an answer as I don't have enough reputation to post comments yet. I can run your example just fine with enaml 0.6.8, so maybe your version of enaml is off?

Another thing to check is whether you can run the examples in the enaml docs, e.g. this one, which also uses ids.

jvkersch
  • 575
  • 1
  • 4
  • 9