lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.78k stars 885 forks source link

About UI layout #758

Open yafengabc opened 3 years ago

yafengabc commented 3 years ago

About UI layout Because there is no tutorial, I don’t know how to resize UI elements E.g: `package main

import ( "github.com/lxn/walk" . "github.com/lxn/walk/declarative" "strings" )

func main() { var inTE, outTE *walk.TextEdit

MainWindow{
    Title:   "SCREAMO",
    MinSize: Size{600, 400},
    Layout:  VBox{},
    Children: []Widget{
        HSplitter{
            Children: []Widget{
                TextEdit{AssignTo: &inTE},
                TextEdit{AssignTo: &outTE, ReadOnly: true},
            },
        },
        PushButton{
            Text: "SCREAM",
            OnClicked: func() {
                outTE.SetText(strings.ToUpper(inTE.Text()))
            },
        },
    },
}.Run()

}

If I want to change the ratio of these two edits, or want a smaller button (not through the entire dialog box), how should I write the code? `