Page 1 of 1

PB6.30B4 - MenuItemState not visible with images

Posted: Mon Nov 24, 2025 6:58 pm
by dige
SetMenuItemState(0, 1, 1) --> Menu status is set to true, but the check mark is not visible.

Code: Select all

;
; ------------------------------------------------------------
;
;   PureBasic - Menu example file
;
;    (c) Fantaisie Software
;
; ------------------------------------------------------------

CreateImage(0, 16, 16, 24, #Red)
CreateImage(1, 16, 16, 24, #Blue)

If CreatePopupMenu(0)
  MenuItem(1, "Option 1", ImageID(0))
  MenuItem(2, "Option 2", ImageID(1))
EndIf

SetMenuItemState(0, 1, 1)

;
If OpenWindow(0, 100, 100, 300, 260, "PureBasic - PopupMenu Example")

  Repeat

    Select WaitWindowEvent()
        
      Case #PB_Event_RightClick       ; rechte Maustaste wurde gedrückt =>
        DisplayPopupMenu(0, WindowID(0))  ; zeige jetzt das Popup-Menü an

      Case #PB_Event_CloseWindow
        Quit = 1

    EndSelect

  Until Quit = 1

EndIf

End