<-- back to the index of Rosetta examples

#### hello world (GUI)

Create a new action hello() that prints "Hello world!" in a modal dialog box using DAD.

##### Example implementations

awk | bas | fawk | lua | pas | pl | py | tcl

##### Explanation, step by step

Create a function hello that will be registered as an action.

When the action is called, build a dad dialog called "heldi", with a single label containing "Hello world!" and a close button that makes the dialog return 0 when clicked. When the dialog is ran in modal mode, it will be open and block other pcb-rnd windows until the user closes it.

Note: the window title (4th parameter of the 3rd dad() call) is displayed because the root node of the DAD is not a box. For a more complex version, see 13_hello_dad.

In the "main" section of the script, register the action using fgw_func_reg().

More details on DAD: DAD developer's doc