Page 1 of 2

Please implement the GtkHeaderBar

Posted: Wed Jan 15, 2014 8:36 pm
by fsw

Re: Please implement the GtkHeaderBar

Posted: Mon Sep 28, 2015 10:31 pm
by fsw
Fred,
Any news on this :?:

Thanks

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 7:59 am
by Fred
No plan for it, what would you use on Windows / OS X ? We usually only add commands which can be used on all OS.

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 8:47 am
by fsw
Fred wrote:... We usually only add commands which can be used on all OS.
Can't argue with this statement :wink:
Thank you for taking the time to answer.

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 9:02 am
by Keya
PB uses GDK for its Linux dialogs as you probably know fsw, so the door is at least open for you to be able to use it yourself directly in your linux PB app with your existing dialogs :)
[edit]See here for an excellent example by yourself heehee :D thanks very much for sharing!!! Im trying to learn too :)

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 9:36 am
by Danilo
What's the headerbar useful for? A menu? A frame?

From the screenshot it looks like easily doable using either CanvasGadget
or a Container combined with Text- and ButtonImageGadget.

What's so special about it?

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 4:15 pm
by fsw
Danilo wrote:What's the headerbar useful for? A menu? A frame?

From the screenshot it looks like easily doable using either CanvasGadget
or a Container combined with Text- and ButtonImageGadget.

What's so special about it?
It's not a frame.
It's a titlebar that can contain more functionality than a normal one.

The funny thing is that anyone using OSX should be familiar with it, as there is something similar on that platform.

Anyhow, I falsely concluded that because PB 5.4 is using GTK3 it will embrace some GTK3 specialities, but I was wrong.

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 4:44 pm
by bbanelli
fsw wrote:Anyhow, I falsely concluded that because PB 5.4 is using GTK3 it will embrace some GTK3 specialities, but I was wrong.
But honestly, to what end? Point of PB should be multiplatform code out of the box, which to most end it delivers.

You created great example using that GTK control yourself, what's the problem? :)

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 5:41 pm
by GPI
fsw wrote:It's not a frame.
It's a titlebar that can contain more functionality than a normal one.
Maybe you descripe it a little more in detail, why we need it....

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 6:48 pm
by fsw
bbanelli wrote:
fsw wrote:Anyhow, I falsely concluded that because PB 5.4 is using GTK3 it will embrace some GTK3 specialities, but I was wrong.
But honestly, to what end? Point of PB should be multiplatform code out of the box, which to most end it delivers.
You are completely right.

However, there are things in the PB libraries that are Windows only, or Windows/Linux only, or Windows/OSX only.
And they are still in the libraries.

The point is that if PB only supports the smallest denominator of all three operating systems it will excel in none.
Maybe you heard the expression: Jack of all trades, master of none.
IMHO this is what will happen with PB.
This is because Windows and OSX implement more and more platform specific UI elements not found on other OS.

With the CompilerIf switch the user could take care of platform dependent code, if it would be implemented in the libraries.
bbanelli wrote:You created great example using that GTK control yourself, what's the problem? :)
Things like the headerbar need a GTK window, a PB window cannot be used.
Therefore all other GUI elements need to be implemented manually.
Not really a problem, but the benefit of PB are the libraries.
At least it was...

Anyhow, I can understand Fred's reasoning, and appreciate his explanation.
Now it's upon me to decide if the next bigger project will be done in PB or something else.
(Using Linux/OSX only...)

IMHO it would add more professionalism to PB.
In any case, it's not my decision how PB will look like in a few months...

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 6:52 pm
by Keya
fsw wrote:Things like the headerbar need a GTK window, a PB window cannot be used.
please pardon my linux newbieness but I thought PB windows in Linux were GTK windows? what framework do they use otherwise?

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 6:54 pm
by fsw
GPI wrote:
fsw wrote:It's not a frame.
It's a titlebar that can contain more functionality than a normal one.
Maybe you descripe it a little more in detail, why we need it....
There is no point in this.
PB is a commercial product.
Therefore only what Fred and Timo see as reasonable will be implemented.
PB will stay a second class citizen on OSX and Linux :wink:

Re: Please implement the GtkHeaderBar

Posted: Tue Sep 29, 2015 7:00 pm
by fsw
Keya wrote:
fsw wrote:Things like the headerbar need a GTK window, a PB window cannot be used.
please pardon my linux newbieness but I thought PB windows in Linux were GTK windows? what framework do they use otherwise?
If you look at my example in the Linux forum you can see for yourself.
Exchange the GTK window with OpenWindow and menu events stop working because the PB window is a "finalized" window (whatever the GTK folks mean with that...)

BTW: I'm a newbie in many things myself...

Re: Please implement the GtkHeaderBar

Posted: Thu Oct 01, 2015 11:54 am
by Shardik
I see a big problem in making available the GtkHeaderBar in PureBasic and that's a problem inherent to Linux distributions: in contrast to Windows or MacOS there exist numerous Windows/Desktop managers in Linux like Gnome 3, KDE, Unity, LXDE, Xfce, Pantheon, Cinnamon, Mate, Enlightenment and several others. And they all seem to implement the GtkHeaderBar differently (if at all!). So I tried fsw's GtkHeaderBar example on Ubuntu 14.04 x64 with these 3 Desktop managers:

KDE:
Image

Unity:
Image

Enlightenment:
Image

As the snapshots prove only on KDE fsw's example allows to drop down the menu list, on Enlightenment the menu title appears but no drop down menu and on Unity only the close button is functional. I assume that fsw only did his tests on Gnome 3 (I am currently on vacation, so that I am not able to check 22 other distributions with different desktop managers on my Linux distribution test machine at work... 8)).

Another problem is that the GtkHeaderBar was introduced with Gtk 3.10 and not so recent Linux distributions with older Gtk3 versions (or Gtk2) won't support the GtkHeaderBar even if the desktop manager would be able to... :wink:

Re: Please implement the GtkHeaderBar

Posted: Thu Oct 01, 2015 6:18 pm
by fsw
@Shardik
I get your point.

However, there is nothing that cannot be solved with CompilerIf.
Information about the enabled session can be obtained through the environment variable.

BTW: Enjoy your vacation. 8)