summaryrefslogtreecommitdiff
path: root/gettext-tools/examples/hello-ycp/hello.ycp
blob: 0affb10e1b9b059a242a587ee6c50c449c942c03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Example for use of GNU gettext.
// This file is in the public domain.

// Source code of the YCP program.

UI(``{
    textdomain "hello-ycp";

    map bash_out = SCR::Execute (.target.bash_output, "echo $PPID");
    integer pid = tointeger (bash_out["stdout"]:"99999");

    OpenDialog (
        `VBox (
             `HBox (
                  `Label (_("Hello, world!")),
                  `HStretch ()
                  ),
             `HBox (
                  `Label (sformat (_("This program is running as process number %1."), pid)),
                  `HStretch ()
                  ),
             `HBox (
                  `HStretch (),
                  `PushButton (`opt(`default), "&OK")
                  )
             )
        );
    UserInput();
    CloseDialog();
})