Add to git.
[monolith.git] / doc / hello.c
1 #include <pool.h>
2
3 #include <monolith.h>
4 #include <ml_window.h>
5 #include <ml_text_label.h>
6
7 /*----- The following standard boilerplate code must appear -----*/
8
9 /* Main entry point to the app. */
10 static void app_main (ml_session);
11
12 int
13 handle_request (rws_request rq)
14 {
15   return ml_entry_point (rq, app_main);
16 }
17
18 /*----- End of standard boilerplate code -----*/
19
20 static void
21 app_main (ml_session session)
22 {
23   pool pool = ml_session_pool (session);
24   ml_window w;
25   ml_text_label text;
26
27   /* Create the top-level window. */
28   w = new_ml_window (session, pool);
29
30   /* Create the text widget. */
31   text = new_ml_text_label (pool, "Hello, World!");
32
33   /* Pack the text widget into the window. */
34   ml_window_pack (w, text);
35 }