Example #1
0
// SetProperty sets a window property.
func (win *window) SetProperty(p sparta.Property, v interface{}) {
	switch p {
	case sparta.Caption:
		if win.w.Property(sparta.Parent) != nil {
			break
		}
		w32.SetWindowText(win.id, v.(string))
	case sparta.Geometry:
		val := v.(image.Rectangle)
		w32.MoveWindow(win.id, val.Min.X, val.Min.Y, val.Dx(), val.Dy(), true)
	case sparta.Foreground:
		val := v.(color.RGBA)
		win.fore = getBrush(val)
	case sparta.Background:
		val := v.(color.RGBA)
		win.back = getBrush(val)
	}
}
Example #2
0
func (this *Window) SetTitle(title string) {
	w32.SetWindowText(this.hwnd, title)
}
Example #3
0
func (this *ControlBase) SetCaption(caption string) {
	w32.SetWindowText(this.hwnd, caption)
}