示例#1
0
文件: label.go 项目: lroc/gowi
func (l Label) Create(window *MainWindow) {
	win := *window.AssignTo
	c := gowi.NewLabel(*win, l.ID)
	if l.Text != nil {
		c.SetWindowText(l.Text.(string))
	}
	if l.AssignTo != nil {
		*l.AssignTo = c
	}
}
示例#2
0
文件: mainwindow.go 项目: lroc/gowi
func NewMainWindow() *MainWindow {
	w := &MainWindow{}

	w.Create(IDD_MAIN)

	b1 := gowi.NewButton(w.MainWindow, IDD_BUTTON1)
	l1 := gowi.NewLabel(w.MainWindow, IDD_LABEL1)

	b1.OnClicked = w.OnButton1Clicked

	l1.SetWindowText("Hello!")

	w.button1 = b1
	w.label1 = l1

	return w
}