To set the id of an object inside that file, you just add an id attribute. For example, <window id="Foo" /> creates a window with an id of Foo.
To refer to the window, you can use the syntax #Foo; #Foo means ``the object whose id is Foo''. For example, <button target="#Foo" /> creates a button, and sets its target to be the object whose id is Foo, that is, the window.
As a more complete example, the following gsmarkup file creates a window, and inside the window a button; clicking on the button will call the performClose: method of the window (which closes the window):
<gsmarkup> <objects> <window id="A"> <button title="Close window" action="performClose:" target="#A" /> </window> </objects> </gsmarkup>Here the window has an id of A, and the button target is set to be the object with id A, which is the window. You can try out this example by replacing the Window.gsmarkup file in our example with this one.