[Solved] PB 5.60 Bug? #PBAny not possible in ImageID

Just starting out? Need help? Post your questions and find answers here.
Klonk
Enthusiast
Enthusiast
Posts: 173
Joined: Tue Jul 13, 2004 2:17 pm

[Solved] PB 5.60 Bug? #PBAny not possible in ImageID

Post by Klonk »

Hi,

can you tell me what I'm doing wrong? Or is it a bug?

This code works:

Code: Select all

If CreatePopupImageMenu(#TrayMenu,#PB_Menu_ModernLook)
      MenuItem(3, "Set Applications", CatchImage(2, ?Prefs))
      MenuItem(2, "Help/About", CatchImage(1, ?Help))
      MenuBar()
      MenuItem(1,"Exit", CatchImage(0, ?Exit))
      SetMenuItemState(#TrayMenu,5,1)
    EndIf
This one doesn't (well the images are not shown in the menu...):

Code: Select all

If CreatePopupImageMenu(#TrayMenu,#PB_Menu_ModernLook)
      MenuItem(3, "Set Applications", CatchImage(#PB_Any, ?Prefs))
      MenuItem(2, "Help/About", CatchImage(#PB_Any, ?Help))
      MenuBar()
      MenuItem(1,"Exit", CatchImage(#PB_Any, ?Exit))
      SetMenuItemState(#TrayMenu,5,1)
    EndIf
Last edited by Klonk on Thu Jul 20, 2017 4:17 pm, edited 1 time in total.
Bye Karl
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: PB 5.60 Bug? #PBAny not possible in ImageID (Catchimage)

Post by nco2k »

Code: Select all

MyImage = CatchImage(#PB_Any, ?Prefs)
MenuItem(3, "Set Applications", ImageID(MyImage))
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PB 5.60 Bug? #PBAny not possible in ImageID (Catchimage)

Post by ts-soft »

Code: Select all

If CreatePopupImageMenu(#TrayMenu,#PB_Menu_ModernLook)
  MenuItem(3, "Set Applications", ImageID(CatchImage(#PB_Any, ?Prefs)))
  MenuItem(2, "Help/About", ImageID(CatchImage(#PB_Any, ?Help)))
  MenuBar()
  MenuItem(1,"Exit", ImageID(CatchImage(#PB_Any, ?Exit)))
  SetMenuItemState(#TrayMenu,5,1)
EndIf 
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Klonk
Enthusiast
Enthusiast
Posts: 173
Joined: Tue Jul 13, 2004 2:17 pm

Re: PB 5.60 Bug? #PBAny not possible in ImageID (Catchimage)

Post by Klonk »

Aah, now I see my mistake.

Many thanks to everyone.
Bye Karl
Post Reply