From df68fb144c94ff7d9d26ca5370bcd274141545dd Mon Sep 17 00:00:00 2001 From: merlinz01 <158784988+merlinz01@users.noreply.github.com> Date: Thu, 12 Dec 2024 21:42:53 -0500 Subject: [PATCH] Assign/revoke control ID's of tab page when inserting/removing --- tabwidget.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tabwidget.go b/tabwidget.go index a1f561c8..11ddb794 100644 --- a/tabwidget.go +++ b/tabwidget.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build windows // +build windows package walk @@ -549,6 +550,8 @@ func (tw *TabWidget) onInsertedPage(index int, page *TabPage) (err error) { return lastError("SetParent") } + page.assignCtrlIDs() + if tw.pages.Len() == 1 { page.SetVisible(true) tw.SetCurrentIndex(0) @@ -596,6 +599,8 @@ func (tw *TabWidget) onRemovedPage(index int, page *TabPage) (err error) { return } + page.revokeCtrlIDs() + win.SendMessage(tw.hWndTab, win.TCM_DELETEITEM, uintptr(index), 0) if tw.pages.Len() > 0 {