MCPcopy
hub / github.com/lxn/walk / SetBoundsPixels

Method SetBoundsPixels

window.go:1432–1445  ·  view source on GitHub ↗

SetBoundsPixels sets the outer bounding box rectangle of the *WindowBase, including decorations. For a Form, like *MainWindow or *Dialog, the rectangle is in screen coordinates, for a child Window the coordinates are relative to its parent.

(bounds Rectangle)

Source from the content-addressed store, hash-verified

1430// For a Form, like *MainWindow or *Dialog, the rectangle is in screen
1431// coordinates, for a child Window the coordinates are relative to its parent.
1432func (wb *WindowBase) SetBoundsPixels(bounds Rectangle) error {
1433 if !win.MoveWindow(
1434 wb.hWnd,
1435 int32(bounds.X),
1436 int32(bounds.Y),
1437 int32(bounds.Width),
1438 int32(bounds.Height),
1439 true) {
1440
1441 return lastError("MoveWindow")
1442 }
1443
1444 return nil
1445}
1446
1447// MinSize returns the minimum allowed outer size for the *WindowBase, including
1448// decorations.

Callers 6

SetBoundsMethod · 0.95
SetSizePixelsMethod · 0.95
SetXPixelsMethod · 0.95
SetYPixelsMethod · 0.95
SetWidthPixelsMethod · 0.95
SetHeightPixelsMethod · 0.95

Calls 1

lastErrorFunction · 0.85

Tested by

no test coverage detected