4

ConfigureEvent を正しい方法で使用しましたか? ウィンドウのサイズを変更したり、位置を変更したりしても、期待どおりにラベルのテキストが「変更済み」に変更されませんか?

module Main =
    open System
    open Gtk
    [<EntryPoint>]
    let Main(args) = 
        Application.Init()
        let win = new MainWindow.MyWindow()
//      -----------------------------------------
        let l = new Label( "None" )
        win.Add l
        win.ConfigureEvent.Add( fun _ ->
            l.Text <- "Changed" )
//      -----------------------------------------
        win.ShowAll()
        Application.Run()
        0
4

1 に答える 1