GTK+tobac (Glade3 to FB code sketcher, GtkBuilder/libglade)

User projects written in or related to FreeBASIC.
TJF
Posts: 3502
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Feb 21, 2011 16:54

@N3trunn3r

Nobody wrote about this problem here. Sorry for your trouble!

I guess you're on win?

What do you get when you start from a console window?
GTK+tobac2.exe

Please post the output.
N3trunn3r
Posts: 92
Joined: Feb 14, 2008 15:48

Postby N3trunn3r » Feb 22, 2011 11:08

Thanks for the fast reply.
Jep, WinXP

I installed glade3-3.6.7-with-GTK+2.16.2.exe
Now it works fine!

Before I had
Gtk+ 2.12.9 Runtime Environment Revision 2.exe

That's probably why. Bugs...

Another question here, if I want to distribute my GTK apps.
What DLLs do I have to include from the GTK+ directory?
TJF
Posts: 3502
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Feb 22, 2011 11:36

N3trunn3r wrote:Now it works fine!

Great - have fun!

N3trunn3r wrote:Before I had
Gtk+ 2.12.9 Runtime Environment Revision 2.exe

Since GTK+tobac uses GtkBuilder, it needs at least GTK 2.16.

N3trunn3r wrote:Another question here, if I want to distribute my GTK apps.
What DLLs do I have to include from the GTK+ directory?

Hopefully you do - as open source!

I recomment not to ship some DLLs with your app and generate a local GTK installation. Your users will end up with a lot of GTK copies on their boxes.

A lot of boxes do allready have GTK, ie for Firefox, Thunderbird, Gimp, Inkscape, ...

Instead I recomment to install GTK system wide, so all apps can use it (ie like 'winaspi.dll'). For that purpose AMIBCT made an NSIS installer script. It checks the users box for a GTK installation. If GTK isn't available or the installation is to old it offers to download and install the desired version (local or system wide - the user can choose). Have a look at

http://www.freebasic.net/forum/viewtopic.php?t=16558
marcov
Posts: 2818
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Feb 22, 2011 12:38

TJF wrote:
I recomment not to ship some DLLs with your app and generate a local GTK installation. Your users will end up with a lot of GTK copies on their boxes.

A lot of boxes do allready have GTK, ie for Firefox, Thunderbird, Gimp, Inkscape, ...


+Dia, but I don't see any GTK dlls in firefox or thunderbird.

As for the rest, are those in compatible versions? ...

Instead I recomment to install GTK system wide, so all apps can use it (ie like 'winaspi.dll'). For that purpose AMIBCT made an NSIS installer script. It checks the users box for a GTK installation. If GTK isn't available or the installation is to old it offers to download and install the desired version (local or system wide - the user can choose). Have a look at

http://www.freebasic.net/forum/viewtopic.php?t=16558


Save a handful of MB (worth 0.001 cents or so at 40 Eur/TB), invite for days of debugging GTK versioning and compatibility. No thanks :-)
TJF
Posts: 3502
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Feb 22, 2011 15:30

marcov wrote:+Dia ...

Find some more here http://gtk-apps.org/index.php

marcov wrote:..., but I don't see any GTK dlls in firefox or thunderbird.

This is what I tried to say. Professional apps don't ship local copies. If GTK isn't available it gets installed online from the net, for system wide access. A PATH is set to the DLLs so all apps can use them.

marcov wrote:As for the rest, are those in compatible versions? ...

Save a handful of MB (worth 0.001 cents or so at 40 Eur/TB), invite for days of debugging GTK versioning and compatibility.

Sorry, didn't understand this?

marcov wrote:... No thanks :-)

Fine - it's easy to say 'No thanks'. May I ask for your alternative (professional and cross-platform FB code, RAD concepts)?
N3trunn3r
Posts: 92
Joined: Feb 14, 2008 15:48

Postby N3trunn3r » Feb 22, 2011 16:14

I think I found a bug, but I can be wrong:

On WinXP if I compile my GTK app without "GUI in source" everything works fine. But if I use "GUI in source" then it crashes with the following error:

glib-critical **: g_path_get_dirname: assertion 'file_name! = NULL' failed
glib-critical **: gdk_pixbuf_new_from_file_utf8: assertion 'filename !=NULL' failed

I didn't use my own code anywhere, just removed the "#ERROR GTK+tobac2: hier Quelltext einfuegen!" lines and run it.
TJF
Posts: 3502
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Feb 22, 2011 16:30

N3trunn3r wrote:I think I found a bug, but I can be wrong:

Thanks for the report. I'll check it!

BTW: The 'GUI in source' switch is for the final version. You don't need it at the moment.
TJF
Posts: 3502
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Feb 22, 2011 16:38

Need more info:
N3trunn3r wrote:... it crashes with the following error:

glib-critical **: g_path_get_dirname: assertion 'file_name! = NULL' failed
glib-critical **: gdk_pixbuf_new_from_file_utf8: assertion 'filename !=NULL' failed

What is crashing? GTK+tobac while sketching? Or your compiled app when executing?
TJF
Posts: 3502
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Feb 22, 2011 17:43

Can't reproduce the bug here!

It may be a problem in executing your GUI-XML-file. I guess you included an image in Glade3. The filename of this image may not get passed to the *_gui.bas file.

Can you send me your GUI-XML-file (.glade/.ui), so that I can reproduce the bug?
marcov
Posts: 2818
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Feb 23, 2011 20:28

TJF wrote:
This is what I tried to say. Professional apps don't ship local copies. If GTK isn't available it gets installed online from the net, for system wide access. A PATH is set to the DLLs so all apps can use them.


I've no global GTK install. There are no GTK files in e.g. program files\common or program files\gtk*, and neither in the c:\windows subtree.

However I do have firefox and mozilla. As said afaik these two don't use GTK on windows (or Mac)

TJF wrote:
marcov wrote:As for the rest, are those in compatible versions? ...

Save a handful of MB (worth 0.001 cents or so at 40 Eur/TB), invite for days of debugging GTK versioning and compatibility.

Sorry, didn't understand this?


The reply was meant to discuss your advise to install GTK globally to save space. I say here that the size savings are token only, and you get an horrible versioning problem instead.

TJF wrote:
marcov wrote:... No thanks :-)

Fine - it's easy to say 'No thanks'. May I ask for your alternative (professional and cross-platform FB code, RAD concepts)?


Well, I do most of my Rad work in Lazarus, and I like that concept the most. Use the best suitable api on each platform. Why do you think I keep on asking about inheritance support? :-)

Oh, and IMHO Glade is not RAD. It is just a form designer.
TJF
Posts: 3502
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Feb 23, 2011 20:53

marcov wrote:I've no global GTK install. There are no GTK files in e.g. program files\common or program files\gtk*, and neither in the c:\windows subtree.

Did you check C:\opt?

marcov wrote:However I do have firefox and mozilla. As said afaik these two don't use GTK on windows (or Mac)

You may have homebrew versions? Both are listed as GTK apps.

Mozilla Firefox - GTK Web Application
Mozilla Thunderbird - GTK Mail Application

marcov wrote:The reply was meant to discuss your advise to install GTK globally to save space. I say here that the size savings are token only, and you get an horrible versioning problem instead.

Still I don't understand. Why do you know that I 'get an horrible versioning problem' (and why don't I know about that)?

OK, I have 4 GTK versions installed. This is to test the apps I'm coding in FB. But as a user I only need one version (the latest).

marcov wrote:Well, I do most of my Rad work in Lazarus, and I like that concept the most. Use the best suitable api on each platform. Why do you think I keep on asking about inheritance support? :-)

Where can I download Lazarus for FB? You know: we're speaking about FreeBasic and cross-platform development here. One code for several platforms.

marcov wrote:Oh, and IMHO Glade is not RAD. It is just a form designer.

http://en.wikipedia.org wrote:Rapid application development (RAD) refers to a type of software development methodology that uses minimal planning in favor of rapid prototyping.

Glade3 is a software application that is used to support RAD.

Yes, you're right: methodology <> software!
Galeon
Posts: 563
Joined: Apr 08, 2009 5:30
Location: Philippines
Contact:

Postby Galeon » Feb 24, 2011 17:21

TJF wrote:
marcov wrote:However I do have firefox and mozilla. As said afaik these two don't use GTK on windows (or Mac)

You may have homebrew versions? Both are listed as GTK apps.

Mozilla Firefox - GTK Web Application
Mozilla Thunderbird - GTK Mail Application


Unfortunately, our beloved Mozilla Firefox do not always use GTK+ :).

https://developer.mozilla.org/en/Configuring_Build_Options:
Graphics Toolkit Section:
ac_add_options --enable-default-toolkit=gtk2|gtk|xlib|qt|cairo-gtk2|cairo-qt|cairo-windows|windows|mac|cocoa|cairo-cocoa|os2|beos|photon
Selects the graphics toolkit.

On trunk / 1.9 (Firefox 3), this should not be needed in any platform; manually selecting a graphics toolkit is likely to result in a non-working or otherwise highly buggy build. The available toolkits differ from those listed above.

For 1.8 branch, this is not needed for Windows/OS2/BeOS/Photon, since these platforms automatically select the correct toolkit. It is also not needed on Mac, unless you are building Camino on an older branch (Camino uses --enable-default-toolkit=cocoa).

On *nix platforms, selects the graphics toolkit to use. GTK2 and GTK were both well-tested. xlib was considered a tier-3 platform. Qt and cairo were experimental, you will find bugs.


GTK+ for Linux, Windows API for Windows, and Cocoa for Mac.

TJF wrote:
marcov wrote:The reply was meant to discuss your advise to install GTK globally to save space. I say here that the size savings are token only, and you get an horrible versioning problem instead.

Still I don't understand. Why do you know that I 'get an horrible versioning problem' (and why don't I know about that)?

OK, I have 4 GTK versions installed. This is to test the apps I'm coding in FB. But as a user I only need one version (the latest).


Commonly, you won't have any versioning problems unless you don't have a version that don't have a certain version, i.e. GDK-Pixbuf is in version 0.16 but 0.22 do not, your application uses 0.22 and needs GDK-Pixbuf, problem arises. Fortunately, GTK+ is "interconnected", i.e. it won't run without a certain important library, even if it is not needed by your application. An example of that is libxml2. So, if you really want to avoid version numbers, or your application needs additional libraries than what you would expect from GTK+, supply GTK+ with your programs. Either way, programs that needs a lot of additional libraries (i.e. GIMP) comes with their own set of GTK+ libraries, and Windows will use them first than the global one.
TJF
Posts: 3502
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Jun 01, 2011 20:57

This project is deprecated.

The follow-on project is named GladeToBac.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest