Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/eXene/examples/widgets/simple.sml
ViewVC logotype

Annotation of /sml/trunk/src/eXene/examples/widgets/simple.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 845 - (view) (download)

1 : monnier 2 (* simple.sml
2 :     *
3 :     * COPYRIGHT (c) 1991,1995 by AT&T Bell Laboratories. See COPYRIGHT file for details.
4 :     *)
5 :     structure Simple :
6 :     sig
7 :     val doit' : string list * string -> unit
8 :     val doit : unit -> unit
9 :     val main : string list * 'a -> unit
10 :     end =
11 :     struct
12 :     structure W = Widget
13 :     structure A = Attrs
14 :    
15 :     val resources = [
16 :     "*background: forestgreen"
17 :     ]
18 :    
19 :     fun goodbye root = let
20 : blume 845 fun quit () = (W.delRoot root; RunCML.shutdown OS.Process.success)
21 : monnier 2 val style = W.styleFromStrings (root, resources)
22 :     val name = Styles.mkView {name = Styles.styleName [],
23 :     aliases = [Styles.styleName []]}
24 :     val view = (name,style)
25 :     val args = [(A.attr_label, A.AV_Str "Goodbye, Cruel World!")]
26 :     val bttn = Button.textCmd (root,view,args) quit
27 :     val layout = Box.layout (root,view,[]) (Box.VtCenter [
28 :     Box.Glue {nat=30, min=0, max=NONE},
29 :     Box.WBox (Button.widgetOf bttn),
30 :     Box.Glue {nat=30, min=0, max=NONE}
31 :     ])
32 :     val shell = Shell.shell (root,view,[]) (Box.widgetOf layout)
33 :     fun loop () =
34 : blume 845 if (TextIO.inputLine TextIO.stdIn) = "quit\n"
35 : monnier 2 then quit ()
36 :     else loop ()
37 :     in
38 :     Shell.init shell;
39 :     loop ()
40 :     end
41 :    
42 :     fun doit' (debugFlags, server) = (
43 :     XDebug.init debugFlags;
44 :     RunEXene.runWArgs goodbye {dpy= SOME server,timeq=NONE}
45 :     )
46 :    
47 :     fun doit () = RunEXene.run goodbye
48 :    
49 :     fun main (prog::server::_,_) = doit'([], server)
50 :     | main _ = doit ()
51 :    
52 :     end (* Simple *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0