From 7f67b6b9011978feb56707ed6651e7b6ec081018 Mon Sep 17 00:00:00 2001 From: tso Date: Thu, 19 Jul 2018 09:33:51 -0400 Subject: [PATCH] add NewTabWidgetWithStyle() - enables a user to apply these styles to a tab widget: https://docs.microsoft.com/en-us/windows/desktop/Controls/tab-control-styles - follows the convention of other functions in this package like NewCompositeWithStyle and NewListBoxWithStyle --- tabwidget.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tabwidget.go b/tabwidget.go index 51d8dc67..0cdec00b 100644 --- a/tabwidget.go +++ b/tabwidget.go @@ -34,6 +34,10 @@ type TabWidget struct { } func NewTabWidget(parent Container) (*TabWidget, error) { + return NewTabWidgetWithStyle(parent, 0) +} + +func NewTabWidgetWithStyle(parent Container, style uint32) (*TabWidget, error) { tw := &TabWidget{currentIndex: -1} tw.pages = newTabPageList(tw) @@ -57,7 +61,7 @@ func NewTabWidget(parent Container) (*TabWidget, error) { tw.hWndTab = win.CreateWindowEx( 0, syscall.StringToUTF16Ptr("SysTabControl32"), nil, - win.WS_CHILD|win.WS_CLIPSIBLINGS|win.WS_TABSTOP|win.WS_VISIBLE, + win.WS_CHILD|win.WS_CLIPSIBLINGS|win.WS_TABSTOP|win.WS_VISIBLE|style, 0, 0, 0, 0, tw.hWnd, 0, 0, nil) if tw.hWndTab == 0 { return nil, lastError("CreateWindowEx")