Draws a one pixel wide border around contained widget

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dget to repaint itself. •  You can ask a simple widget to tell you its size. •  Both operaZons are relaZve to a graphics context CIS120/ Spring 2011 Widget Examples simpleWidget.ml (* Display a string on the screen. *)! let label (s:string) : t =! {! repaint = (fun (g:Gctx.t) -> Gctx.draw_string g s);! size = (fun (g:Gctx.t) -> Gctx.text_size g s) ! }! simpleWidget.ml (* A region of empty space. let space ((w,h):int*int) : {! repaint = (fun (_:Gctx.t) size = (fun (_:Gctx.t) }! CIS120 / Spring 2011 *)! t =! ->...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online