Page 1 of 1

Missing ToolBar in Wine

Posted: Wed Oct 29, 2025 7:24 am
by TassyJim
Hi,
I have a number of users who prefer to use the Windows version of my software under Wine rather than the Linux version.
I have discovered that the ToolBar does not appear in Wine.
I have tried with PB6.21 and PB6.04
I have tried setting the bitmap size using SendMessage_(ToolBarID(0),#TB_SETBITMAPSIZE, 0,24<<16+24) with no success.

I am testing with the examples in the help:

Code: Select all

If OpenWindow(0, 0, 0, 150, 50, "ToolBar", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  If CreateToolBar(0, WindowID(0))
      UsePNGImageDecoder()
      Path$ = #PB_Compiler_Home  + "Examples" + #PS$ + "Sources" + #PS$ + "Data" + #PS$ + "ToolBar" + #PS$ + ""
      ToolBarImageButton(0, LoadImage(0, Path$ + "New.png"))
      ToolBarImageButton(1, LoadImage(1, Path$ + "Open.png"))
      ToolBarImageButton(2, LoadImage(2, Path$ + "Save.png"))
      SendMessage_(ToolBarID(0),#TB_SETBITMAPSIZE, 0,24<<16+24)
    EndIf
    Repeat
      Event = WaitWindowEvent()
      If Event = #PB_Event_Menu
        Debug "ToolBar ID: "+Str(EventMenu())
      EndIf
    Until Event = #PB_Event_CloseWindow 
  EndIf
Tried using ico files but no joy.
The toolbar IS there and tooltips appear if you get the mouse "just right" but the buttons are very small and unresponsive.

Any ideas?
I would like to avoid creating my own ToolBar.

Re: Missing ToolBar in Wine

Posted: Wed Oct 29, 2025 8:17 am
by RASHAD
Hi
Try the next maybe

Code: Select all

UsePNGImageDecoder()

If OpenWindow(0, 0, 0, 150, 150, "ToolBar", #PB_Window_SystemMenu | #PB_Window_ScreenCentered|#PB_Window_SizeGadget)
  If CreateToolBar(0, WindowID(0),#PB_ToolBar_Large )
      Path$ = #PB_Compiler_Home  + "Examples" + #PS$ + "Sources" + #PS$ + "Data" + #PS$ + "ToolBar" + #PS$ + ""
      ToolBarImageButton(0, LoadImage(0, Path$ + "New.png"),#PB_ToolBar_Normal)
      ToolBarImageButton(1, LoadImage(1, Path$ + "Open.png"),#PB_ToolBar_Normal)
      ToolBarImageButton(2, LoadImage(2, Path$ + "Save.png"),#PB_ToolBar_Normal)
    EndIf
    Repeat
      Event = WaitWindowEvent()
      If Event = #PB_Event_Menu
        Debug "ToolBar ID: "+Str(EventMenu())
      EndIf
    Until Event = #PB_Event_CloseWindow 
  EndIf

Re: Missing ToolBar in Wine

Posted: Wed Oct 29, 2025 9:43 pm
by TassyJim
Thanks.
#PB_ToolBar_Large was the first thing I tried.

Re: Missing ToolBar in Wine

Posted: Thu Oct 30, 2025 5:22 pm
by deeproot
@TassyJim Sorry I can't offer any help but just wanted to make a comment. A very long time ago I had exactly the same problem. Everything else worked fine, but no toolbar. Never found a solution using the standard toolbar, but read somewhere it was quite a common issue with Wine and some programs, not just PureBasic-built ones (was a very, very long time ago though!).