0
Setup definiert: mono 4.5, Linux, f # 4.0, gtk #mit GTK # DrawingArea in F #: ExposeEvent nicht
mein Code hier, vor allem aus Probe Schnipsel kopiert:
open System
open Gtk
let (width, height) = (800, 600)
[<EntryPoint>]
let main argv =
Application.Init()
let window = new Window ("helloworld")
window.SetDefaultSize(width, height)
window.DeleteEvent.Add(fun e -> window.Hide(); Application.Quit(); e.RetVal <- true)
let drawing = new Gtk.DrawingArea()
drawing.ExposeEvent.Add(fun x ->
let gc = drawing.Style.BaseGC(StateType.Normal)
let allocColor (r,g,b) =
let col = ref (Gdk.Color(r,g,b))
let _ = gc.Colormap.AllocColor(col, true, true)
!col
gc.Foreground <- allocColor (255uy, 0uy, 0uy)
drawing.GdkWindow.DrawLine(gc, 0, 0, 100, 100)
)
window.Add(drawing)
window.ShowAll()
window.Show()
Application.Run()
0
Es schlägt fehl, zu kompilieren mit folgendem Fehler:
The field, constructor or member 'ExposeEvent' is not defined