Page 1 of 1

[SOLVED] ToolBarSeparator()

Posted: Fri Aug 28, 2015 1:55 pm
by Joubarbe
Hey (again !)

Code: Select all

OpenWindow(0, 100, 100, 320, 200, "")

CreateToolBar(0, WindowID(0))
ToolBarStandardButton(0, #PB_ToolBarIcon_New)
ToolBarStandardButton(1, #PB_ToolBarIcon_Open)
ToolBarSeparator()
ToolBarStandardButton(2, #PB_ToolBarIcon_Help)

Repeat
  
  event = WaitWindowEvent()
    
Until event = #PB_Event_CloseWindow
The separator does not show. There's no vertical bar, just a blank space. Note that the separator does show in other applications, such as gedit.

(Linux Mint 17.2)

Re: ToolBarSeparator()

Posted: Fri Aug 28, 2015 2:42 pm
by heartbone
UBUNTU 14.04 x86 PB 5.22
I see the separator bar.

Re: ToolBarSeparator()

Posted: Fri Aug 28, 2015 3:22 pm
by davido
@Joubarbe,

Are you working on a Mac?

Mac OSX is not supported by PureBasic, for ToolbarSeparator().
See manual: You can click on CreateToolBar in your code and press F1 to see.

Re: ToolBarSeparator()

Posted: Fri Aug 28, 2015 5:37 pm
by Joubarbe
@davido : this is the Linux topic, so no :) Mint 17.2 (added that to the OP).

Nonetheless, there's nothing in the help file that indicates that the separator is not OSX compatible. All OS are said to be supported.

Re: ToolBarSeparator()

Posted: Fri Aug 28, 2015 6:33 pm
by Trond
This depends on the GTK 2 theme. Gedit uses GTK 3, which has separate themes.

Re: ToolBarSeparator()

Posted: Fri Aug 28, 2015 8:58 pm
by Joubarbe
Yep, that's what I figured. And I can't seem to make gtk3 works, so that's either a gtk2 bug, or a PB one.

Re: ToolBarSeparator()

Posted: Fri Aug 28, 2015 10:18 pm
by davido
@Joubarbe,
My apologies. :oops:

Re: ToolBarSeparator()

Posted: Sat Aug 29, 2015 6:20 am
by Oma
Hi Joubarbe.

I don't have Mint 17.2 to test it, but on 17.1 it depends on the choosed theme:
With 'Mint-X-????' on the controls, there's only a small spaces between the buttons,
with e.g. 'Adwaita'-theme the line appears in the toolbar.

There's API-command ...
gtk_separator_tool_item_set_draw (GtkSeparatorToolItem *item, gboolean draw)
which switches between a line or space.
And here's the real problem. There's no simple way to get the *item (widget-adress of toolbar-element) from PureBasic to switch to the 'line'-mode. The better way would be, that PB-commands like ToolBarSeparator() with a empty 'Return', would return the widget-adress to get API-access to toolbar-elements.

Regards, Charly

Re: ToolBarSeparator()

Posted: Sat Aug 29, 2015 7:32 am
by Joubarbe
Thanks a lot Oma for this clarification. Indeed, when changing the theme ("controls"), it works.

Not a huge problem then :)