Gtk2 API and Examples

I’ve created Gtk+2 API Library and several examples on how to use it.


Feel free to give a feedback by open an issue or create a PR.

Have you double checked these with the 2017r2/r3 changes to GTK-3?

Not sure what do you mean. Other xojo user has already shared Gtk3 API. This library provide Gtk2 API only and currently tested with xojo < 2017r2. However, that’s interesting, I’ll check if this library can be used with xojo >= 2017r2.

That’s what I mean - can your GTK-2 module be used with the new version of Xojo.

Quick test using Xojo2017r2, it works.

For MBS Plugin, we dynamically load either gtk 2 or 3 libraries depending on the Xojo host version.

For Your declares, you may want to make sure you keep the library name as a constant, so people can easy switch between the both library names: vs

Since Gtk3 released two(?) versions of theme, I don’t really like it. I prefer to choose Gtk2 over Gtk3.

You have no choice. If gtk3 is missing, a Xojo 2017r3 app will not launch.

Gtk3 doesn’t have a problem running in my system. I only prefer to develop using Gtk2 over Gtk3. I’m waiting Gtk4 first stable release to see what is it :smiley:

Linux Mint 18.3 64bit - Xojo 2016R4.1

I looked at it. They are all console apps.
Too bad, but none of the examples runs in debug mode.
My license is for desktop only, so I can not build it. =(

Sorry about that.

I’ve pushed desktop version into repository. Please check it. Tested desktop version on Linux mint and it works.
Seems there is dependency conflict when execute desktop example using Xojo >= 2017r2.

I’m getting a functionNotfoundexception on this line:

  gtk_init(argc, argv) 

please type this on your console

ldconfig -p | grep libgtk-

and paste the result here.

What’s your distro?

I got
-bash: ldconfig: command not found

macOS High Sierra 10.13.3

Edit: I looked it up seems like it’s a Linux thing

Oh sorry, currently this library only run on linux. I don’t put #If Not TargetLinux because I think everybody knows Gtk is linux library. My bad.

In this page, there is Gtk for Mac. But, I don’t have Mac. So, I don’t know dylib name of gtk shared library on Mac.

You can check Gtk+2 library on your system and replace Gtk2Lib constant value with the dylib name.

No worries,
I saw “ModGtkStatusbar.xojo_code” and for some reason thought statusitem :slight_smile:
I will install Linux Mint when I get the chance.

Thanks Asis.

You’re welcome :slight_smile: