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

Method RequestLayout

window.go:1876–1922  ·  view source on GitHub ↗

RequestLayout either schedules or immediately starts performing layout.

()

Source from the content-addressed store, hash-verified

1874
1875// RequestLayout either schedules or immediately starts performing layout.
1876func (wb *WindowBase) RequestLayout() {
1877 var form Form
1878
1879 hwnd := wb.hWnd
1880 window := wb.window
1881
1882 for hwnd != 0 {
1883 if window != nil {
1884 var ok, visible bool
1885 if form, ok = window.(Form); ok {
1886 visible = form.Visible()
1887 } else {
1888 visible = window.AsWindowBase().visible
1889 }
1890
1891 if !visible && window != wb.window || window.Suspended() {
1892 return
1893 }
1894
1895 if container, ok := window.(Container); ok && container.Layout() == nil {
1896 return
1897 }
1898
1899 if widget, ok := window.(Widget); ok {
1900 if window = widget.Parent(); window != nil {
1901 hwnd = window.Handle()
1902 continue
1903 }
1904 }
1905 } else if !win.IsWindowVisible(hwnd) {
1906 return
1907 }
1908
1909 hwnd = win.GetParent(hwnd)
1910 window = windowFromHandle(hwnd)
1911 }
1912
1913 if form == nil {
1914 return
1915 }
1916
1917 if fb := form.AsFormBase(); fb.group.ActiveForm() != form || fb.inProgressEventCount == 0 {
1918 fb.startLayout()
1919 } else {
1920 fb.layoutScheduled = true
1921 }
1922}
1923
1924// RightToLeftReading returns whether the reading order of the Window
1925// is from right to left.

Callers 2

SetSuspendedMethod · 0.95
SetVisibleMethod · 0.95

Calls 10

AsFormBaseMethod · 0.95
windowFromHandleFunction · 0.85
startLayoutMethod · 0.80
VisibleMethod · 0.65
AsWindowBaseMethod · 0.65
SuspendedMethod · 0.65
LayoutMethod · 0.65
ParentMethod · 0.65
HandleMethod · 0.65
ActiveFormMethod · 0.45

Tested by

no test coverage detected