@@ -50,7 +50,7 @@ func main() {
5050 hiddenFirstItem := indexMenu .Add ("Hidden First Item" ).SetHidden (true )
5151 indexMenu .Add ("Toggle Hidden First Item" ).OnClick (func (* application.Context ) {
5252 hiddenFirstItem .SetHidden (! hiddenFirstItem .Hidden ())
53- menu .Update (true )
53+ menu .Update ()
5454 println ("Toggled visibility of first item - Now hidden:" , hiddenFirstItem .Hidden ())
5555 })
5656 indexMenu .AddSeparator ()
@@ -67,7 +67,7 @@ func main() {
6767 item .OnClick (func (* application.Context ) {
6868 println ("Clicked on inserted item!" )
6969 })
70- menu .Update (true )
70+ menu .Update ()
7171 println ("Inserted item at index 1" )
7272 })
7373
@@ -77,7 +77,7 @@ func main() {
7777 checkbox .OnClick (func (ctx * application.Context ) {
7878 println ("Checkbox clicked, checked:" , ctx .ClickedMenuItem ().Checked ())
7979 })
80- menu .Update (true )
80+ menu .Update ()
8181 println ("Inserted checkbox at index 2" )
8282 })
8383
@@ -111,7 +111,7 @@ func main() {
111111 newCheckbox .OnClick (func (ctx * application.Context ) {
112112 println ("Checkbox B clicked, checked:" , ctx .ClickedMenuItem ().Checked ())
113113 })
114- menu .Update (true )
114+ menu .Update ()
115115 println ("Inserted Checkbox B after Checkbox A" )
116116 })
117117
@@ -148,7 +148,7 @@ func main() {
148148 newRadio .OnClick (func (ctx * application.Context ) {
149149 println ("Radio C clicked, checked:" , ctx .ClickedMenuItem ().Checked ())
150150 })
151- menu .Update (true )
151+ menu .Update ()
152152 println ("Inserted Radio C after Radio B" )
153153 })
154154
@@ -157,7 +157,7 @@ func main() {
157157 // Demonstrate InsertSeparatorAt
158158 indexMenu .Add ("Insert separator at index 3" ).OnClick (func (* application.Context ) {
159159 indexMenu .InsertSeparatorAt (3 )
160- menu .Update (true )
160+ menu .Update ()
161161 println ("Inserted separator at index 3" )
162162 })
163163
@@ -176,7 +176,7 @@ func main() {
176176 submenu := indexMenu .InsertSubmenuAt (count , "Inserted Submenu" )
177177 submenu .Add ("Submenu Item 1" )
178178 submenu .Add ("Submenu Item 2" )
179- menu .Update (true )
179+ menu .Update ()
180180 println ("Inserted submenu at end" )
181181 })
182182
@@ -210,7 +210,7 @@ func main() {
210210 item := indexMenu .ItemAt (targetIndex )
211211 if item != nil {
212212 item .SetEnabled (! item .Enabled ())
213- menu .Update (true )
213+ menu .Update ()
214214 println ("Toggled enabled state for item at index" , targetIndex , "- Now enabled:" , item .Enabled ())
215215 }
216216 })
@@ -245,7 +245,7 @@ func main() {
245245 item := indexMenu .ItemAt (hidableIndex )
246246 if item != nil {
247247 item .SetHidden (! item .Hidden ())
248- menu .Update (true )
248+ menu .Update ()
249249 println ("Toggled hidden state for item at index" , hidableIndex , "- Now hidden:" , item .Hidden ())
250250 }
251251 })
@@ -329,7 +329,7 @@ func main() {
329329 println ("Submenu is now hidden" )
330330 }
331331 // Update the menu to reflect the changes
332- menu .Update (true )
332+ menu .Update ()
333333 })
334334
335335 myMenu .AddSeparator ()
@@ -376,7 +376,7 @@ func main() {
376376 myMenu .Add ("Append a new item" ).OnClick (func (* application.Context ) {
377377 myMenu .AppendItem (newItem )
378378 // Use Update(true) to update everything in one call
379- menu .Update (true )
379+ menu .Update ()
380380 println ("Appended a new item to the menu" )
381381 })
382382
@@ -393,7 +393,7 @@ func main() {
393393 if lastIndex >= 0 {
394394 myMenu .Remove (lastIndex )
395395 // Use Update(true) to update everything in one call
396- menu .Update (true )
396+ menu .Update ()
397397 println ("Removed the last item from the menu" )
398398 } else {
399399 println ("No items to remove" )
@@ -412,7 +412,7 @@ func main() {
412412 // Add a menu item to toggle the enabled state of the disabled item
413413 disabledMenu .Add ("Toggle Enabled State" ).OnClick (func (* application.Context ) {
414414 disabledItem .SetEnabled (! disabledItem .Enabled ())
415- menu .Update (true )
415+ menu .Update ()
416416 println ("Toggled enabled state - Now enabled:" , disabledItem .Enabled ())
417417 })
418418
@@ -428,7 +428,7 @@ func main() {
428428 menuUpdateDemo .Add ("Reset menu" ).OnClick (func (ctx * application.Context ) {
429429 menuUpdateDemo .Clear ()
430430 menuUpdateDemo .Add ("New option" )
431- menu .Update (true )
431+ menu .Update ()
432432 // Explicitly set the menu on the application and window to ensure it's updated
433433 app .SetMenu (menu )
434434 if app .CurrentWindow () != nil {
@@ -451,7 +451,7 @@ func main() {
451451 // Change the label
452452 submenuItem .SetLabel ("Parent Updated Label" )
453453 // Update the menu to reflect the changes
454- menu .Update (true )
454+ menu .Update ()
455455 println ("Submenu label changed from parent to: Parent Updated Label" )
456456
457457 // Verify the change
@@ -474,7 +474,7 @@ func main() {
474474 // Change the label
475475 submenuItem .SetLabel ("Updated Submenu Label" )
476476 // Update the menu to reflect the changes
477- menu .Update (true )
477+ menu .Update ()
478478 println ("Submenu label changed to: Updated Submenu Label" )
479479
480480 // Verify the change
@@ -497,7 +497,7 @@ func main() {
497497 // Change the label
498498 submenuItem .SetLabel ("Updated Operations" )
499499 // Update the menu to reflect the changes
500- menu .Update (true )
500+ menu .Update ()
501501 println ("Submenu label changed to: Updated Operations" )
502502
503503 // Verify the change
@@ -525,7 +525,7 @@ func main() {
525525 // Change the label
526526 submenuItem .SetLabel ("Self-Updated Submenu" )
527527 // Update the menu to reflect the changes
528- menu .Update (true )
528+ menu .Update ()
529529 println ("Nested submenu changed its own label to: Self-Updated Submenu" )
530530
531531 // Verify the change
@@ -548,7 +548,7 @@ func main() {
548548 // Change the label
549549 submenuItem .SetLabel ("Updated Nested Submenu" )
550550 // Update the menu to reflect the changes
551- menu .Update (true )
551+ menu .Update ()
552552 println ("Nested submenu label changed to: Updated Nested Submenu" )
553553
554554 // Verify the change
0 commit comments