Control Out Inherits Canvas
ControlInstance Out Inherits Canvas
EventHandler Sub Open()
dim w as integer = me.Width
dim h as integer = me.Height
dim ww as integer = w / 2
dim hh as integer = h / 2
dim view as NSViewMBS = me.NSViewMBS
dim t1 as new MyNSViewTooltipMBS
t1.Text = "blue"
dim r1 as new NSRectMBS(0, 0, ww, hh)
view.addToolTipRect r1, t1
tooltips.Append t1
dim t2 as new MyNSViewTooltipMBS
t2.Text = "gray"
dim r2 as new NSRectMBS(ww, 0, ww, hh)
view.addToolTipRect r2, t2
tooltips.Append t2
dim t3 as new MyNSViewTooltipMBS
t3.Text = "red"
dim r3 as new NSRectMBS(0, hh, ww, hh)
view.addToolTipRect r3, t3
tooltips.Append t3
dim t4 as new MyNSViewTooltipMBS
t4.Text = "green"
dim r4 as new NSRectMBS(ww, hh, ww, hh)
view.addToolTipRect r4, t4
tooltips.Append t4
End EventHandler
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect)
dim w as integer = g.Width
dim h as integer = g.Height
dim ww as integer = w / 2
dim hh as integer = h / 2
g.ForeColor = &cFF9999
g.FillRect 0, 0, ww, hh
g.ForeColor = &c99FF99
g.FillRect ww, 0, ww, hh
g.ForeColor = &c9999FF
g.FillRect 0, hh, ww, hh
g.ForeColor = &c999999
g.FillRect ww, hh, ww, hh
End EventHandler
End Control