SetTabBarGadgetItemImage( #TabBarGadget, 0, CatchImage(#Image_Image_18, ?Image_Image_18))
I have UsePNGImageDecoder() declared since it is a .png file, but the image does not get displayed on the tab


What am I missing here? The tabs in the IDE are courtesy of STARGATE's TabBarGadget, Bisonte was just pointing out a fact - right? Or did something go over my head?Gee, just what a need, a comedian.

Yes, right over your head because you are shorter than me. (I saw a bald spot!! And a bird's nest??? ) It was easy enough to understand that I meant included as a component for programmers to access. heh, heh, heh, heh.What am I missing here? The tabs in the IDE are courtesy of STARGATE's TabBarGadget, Bisonte was just pointing out a fact - right? Or did something go over my head?


No, a native pb gadget with pb commands would be better:):) PBISE the heck out of good stuff like that!!!This is even better than a native gadget.
Good code like that would be nice to be native, it's so nice to have. Being in the visual designer would be even betetr for bad old eyes.Complete with source code so you can tweak/upgrade it yourself.
Thank you so much for making me fall out of the chair snorting mouthwash through both nostrils and squich the can!!And I sprayed my bald spot, so you were lying when you said you saw it!
Code: Select all
SetTabBarGadetColor(Gadget.i, Color.i)Code: Select all
XIncludeFile "TabBarGadget.pbi"
Enumeration
  #MainForm
  #TB
EndEnumeration
Procedure OnTabBarClick()
  
  Protected Position.i
  Static Number.i = 3
  
  Select EventType()      
    Case #TabBarGadget_EventType_Change
      Debug "selected item changed, now at position "+Str(GetTabBarGadgetItemPosition(EventGadget(), #TabBarGadgetItem_Event))
      
  EndSelect
  
EndProcedure
OpenWindow(#MainForm, 0, 0, 800, 600, "TabBarGadget test", #PB_Window_ScreenCentered|#PB_Window_SystemMenu)
SetWindowColor(#MainForm, RGB(210, 180, 140))
;I have one feature request : A function to change the background color of the tabbargadget. 
;Example : SetTabBarGadetColor(Gadget.i, Color.i)
TabBarGadgetInclude\TabBarColor = RGB(210, 180, 140) ;Comment this line To see the difference
TabBarGadget(#TB, 10, 60, WindowWidth(#MainForm)-20, 30, #TabBarGadget_CloseButton, #MainForm)
  AddTabBarGadgetItem(#TB, #PB_Default, "Any tab 1")
  AddTabBarGadgetItem(#TB, #PB_Default, "Any tab 2")
  AddTabBarGadgetItem(#TB, #PB_Default, "Any tab 3")
SetTabBarGadgetState(#TB, 0)
ContainerGadget(-1, 5, 90, WindowWidth(#MainForm)-10, 500)
CloseGadgetList()
BindGadgetEvent(#TB, @OnTabBarClick())
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow Code: Select all
  ResizeGadget(#TB, #PB_Ignore, #PB_Ignore, WindowWidth(#MainForm)-20, #PB_Ignore)
  SetTabBarGadgetAttribute(#TB, #PB_Ignore, WindowWidth(#MainForm)-20)
Code: Select all
XIncludeFile "TabBarGadget.pbi"
Enumeration Font
  #FontGlobal
EndEnumeration
Enumeration Window
  #MainForm
  #PopupMenu
EndEnumeration
Enumeration Gadget
  #TB
  #Container
EndEnumeration
Declare Start()
Declare OnTabBarClick()
Declare OnResize()
Declare OnExit()
Start()
Procedure Start()
  LoadFont(#FontGlobal, "", 10)
  SetGadgetFont(#PB_Default, FontID(#FontGlobal))
  OpenWindow(#MainForm, 0, 0, 800, 600, "TabBarGadget Test", #PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_SizeGadget)
  SetWindowColor(#MainForm, RGB(245, 222, 179))
  
  ;Tabbargadget. 
  TabBarGadgetInclude\TabBarColor = GetWindowColor(#MainForm)
  
  TabBarGadget(#TB, 10, 60, WindowWidth(#MainForm)-20, 40, #TabBarGadget_PopupButton, #MainForm)
  AddTabBarGadgetItem(#TB, #PB_Default, "Any tab 1")
  AddTabBarGadgetItem(#TB, #PB_Default, "Any tab 2")
  AddTabBarGadgetItem(#TB, #PB_Default, "Any tab 3")
  SetTabBarGadgetState(#TB, 0) ;Set active panel
  
  SetTabBarGadgetItemColor(#TB, 0, #PB_Gadget_BackColor, RGB(255, 255, 255) )
  SetTabBarGadgetItemColor(#TB, 1, #PB_Gadget_BackColor, RGB(210, 180, 140) )
  SetTabBarGadgetItemColor(#TB, 2, #PB_Gadget_BackColor, RGB(210, 180, 140) )
  
  ;Container
  ContainerGadget(#Container, 5, 100, WindowWidth(#MainForm) - 10,  WindowHeight(#MainForm) - 120)
  CloseGadgetList()
  
  ;PoppupButton Menu
  CreatePopupMenu(#PopupMenu)
  MenuItem(0, "Setup")
  MenuItem(1, "Exit")
     
  ;Trigger
  BindGadgetEvent(#TB, @OnTabBarClick())
  BindMenuEvent(#PopupMenu, 1, @OnExit())
  BindEvent(#PB_Event_SizeWindow, @OnResize())
  BindEvent(#PB_Event_CloseWindow, @OnExit())
  
  Repeat : WaitWindowEvent() : ForEver
EndProcedure
Procedure OnTabBarClick()
  Static OlDPosition.i
  Protected Position.i = GetTabBarGadgetItemPosition(EventGadget(), #TabBarGadgetItem_Selected)
  
  Select EventType()
    Case #TabBarGadget_EventType_PopupButton
      DisplayPopupMenu(#PopupMenu, WindowID(#MainForm))  
      
    Case #TabBarGadget_EventType_Change
      SetTabBarGadgetItemColor(#TB, OlDPosition, #PB_Gadget_BackColor, RGB(210, 180, 140) )
      SetTabBarGadgetItemColor(#TB, Position, #PB_Gadget_BackColor, RGB(255, 255, 255) )    
      OlDPosition = Position  
  EndSelect
  
EndProcedure
Procedure OnResize()
  ;Resize tabbargadget
  ResizeGadget(#TB, #PB_Ignore, #PB_Ignore, WindowWidth(#MainForm)-20, #PB_Ignore)
  SetTabBarGadgetAttribute(#TB, #PB_Ignore, WindowWidth(#MainForm)-20)
  
  ;Resize container
  ResizeGadget(#Container, #PB_Ignore, #PB_Ignore, WindowWidth(#MainForm)-10, WindowHeight(#MainForm) - 120)
EndProcedure
Procedure OnExit()
  End
EndProcedureCode: Select all
Procedure OnResize()
  ;Resize tabbargadget
  ResizeGadget(#TB, #PB_Ignore, #PB_Ignore, WindowWidth(#MainForm)-20, #PB_Ignore)
  UpdateTabBarGadget(#TB)
  
  ;Resize container
  ResizeGadget(#Container, #PB_Ignore, #PB_Ignore, WindowWidth(#MainForm)-10, WindowHeight(#MainForm) - 120)
EndProcedure
Code: Select all
PostEvent(#PB_Event_Gadget, \TabBarGadget\Window, \TabBarGadget\Number, #TabBarGadget_EventType_Pushed, \Type)Any ideas? Event bug in PB? I am going to update the OS to 10.12.1 and see what happens.nextEventMatchingMask should only be called from the Main Thread!