Hello World

Every new app needs its “Hello World” example in order to familiarize users about user interface and basic functionalities. An appropriate “Hello World” app for Creo could be a simple button that is able to open a new window.

1. Start Creo and choose “New Empty” from the Wizard window.

Creo Wizard

A new empty project is a Window1 inside a Navigation1.

Creo new empty project

2. Create a new window using the “New Window” button on bottom left and then reselect Window1.

Creo new window

3. Drop a button from the Objects pane to Window1.

Button dropped into Window1

4. Reveal Code Editor using the “Code Editor” button from the document toolbar. Select Button1 Action event from the Events group and write the following Gravity code:
Window1.open(Window2);
Window2.openIn(Navigation1);

Button1 open Window code

5. Press Run Simulator button into Toolbar:

Download “Hello World” project.

Notes about beta 5.3
Starting from Creo 1.0b5.3 you could also use Window2.open(); to achieve the same behavior.
It means open Window2 in current active Navigation.

9 thoughts on “Hello World

    • NavigationBar Visibility is a per Window setting.
      So you need to set its Visibility to Hidden in both Window1 and Window2 in the Hello World example.

    • Hi,
      starting from Creo b2 you’ll be able to use the syntax:
      Window2.open();
      to open a specified Windows based on table row selection.

  1. Can you please update the hello world tutorial – or better yet put it on github somewhere so you can just update it when you push new builds?

Leave a Reply

Your email address will not be published. Required fields are marked *