Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Draw-a-pixel/Standard-ML/draw-a-pixel.ml
Normal file
22
Task/Draw-a-pixel/Standard-ML/draw-a-pixel.ml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
open XWindows ;
|
||||
open Motif ;
|
||||
|
||||
val imgWindow = fn () =>
|
||||
|
||||
let
|
||||
val shell = XtAppInitialise "" "demo" "top" [] [ XmNwidth 320, XmNheight 240 ] ;
|
||||
val main = XmCreateMainWindow shell "main" [ XmNmappedWhenManaged true ] ;
|
||||
val canvas = XmCreateDrawingArea main "drawarea" [ XmNwidth 320, XmNheight 240 ] ;
|
||||
val usegc = DefaultGC (XtDisplay canvas) ;
|
||||
val put = fn (w,s,t) => ( XSetForeground usegc 0xff0000 ;
|
||||
XDrawPoint (XtWindow canvas) usegc ( XPoint {x=100,y=100} ) ; t);
|
||||
in
|
||||
|
||||
(
|
||||
XtSetCallbacks canvas [ (XmNexposeCallback , put) ] XmNarmCallback ;
|
||||
XtManageChild canvas ;
|
||||
XtManageChild main ;
|
||||
XtRealizeWidget shell
|
||||
)
|
||||
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue