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

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

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

Postby TJF » Dec 09, 2009 19:43

[EDIT]
    This project is deprecated. The follow-on project is named GladeToBac.
[/EDIT]


GTK+tobac means (GTK+ to Basic). It's a FreeBasic Code Sketcher for generating/updating FB source code for an existing Glade3 GUI-XML file. The FB source code uses the Gimp Tool Kit (GTK+) to implement cross-platform GUI widgets (windows/UNIX).

So GTK+tobac supports rapid application development (RAD) of FreeBasic applications with a graphic user interface (GUI).

In Glade3 the GUI will be designed and saved as an XML-file (*.ui = GktBuilder or *.glade = libglade). GTK+tobac can load and analize this file and then generate some cross platform FreeBasic source code to show and handle the GUI-widgets on Win32 or Unix/Linux.

Unlike glade2bas (haegartheroot) or glade2fb (Galeon), GTK+tobac uses an alternative method to bind the GUI-XML file to the FreeBasic source, targeting a higher level of automation. GTK+tobac supports the automatic generation of a first draft, as well as further expansion or reviews of the GUI-XML-file. Therefor GTK+tobac is recommended for big software projects.

Some features:
    * automatic generation of matching callback parameter lists
    * generates source code for GtkBuilder (*.ui) or libglade (.glade)
    * generates references for Objects (Widgets)
    * up to date GTK binding 'inc/GTK-2.22.0_TJF.bi' included
    * can be used with older GTK versions as well
    * multilingual GUI (English/German)
    * automation due to command line parameter
    * folder for GUI files (tobac)
    * integration of Glade file into binary
    * Generates ReadMe.txt and makefile
    * Generates project files for different IDEs
    * GPLv3, source code included
    * self hosting (source is example on how to use)

Download:
http://www.freebasic-portal.de/downloads/ressourcencompiler/gtktobac2-2-0-131.html

How to use (installing Glade3, GTK+ and GTK+tobac):
    1
    2 Download GTK+tobac and unzip in some folder.
    3 Run ./GTK+tobac (GTK+tobac.exe).
    4 You may use a copy of 'src\GTK+tobac.ui' as a test-file and check the '/src/*.bas'-files for an example.


Edit: link to current version, text improvements.
Last edited by TJF on Jun 01, 2011 20:59, edited 12 times in total.
Jim Barlow
Posts: 42
Joined: Sep 23, 2005 0:37

Postby Jim Barlow » Dec 10, 2009 2:31

Looks good, more english, please.
TJF
Posts: 3473
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Dec 10, 2009 6:30

Jim Barlow wrote:Looks good ...

Thank you!

Jim Barlow wrote:..., more english, please.

Here you are:
    1) Setup GTK to English (see http://www.gtk.org).
    2) Run GTK+tobac2 and press Crtl-L (or choose menu 'Hilfe' -> 'English', or use parameter -len at command line prompt like 'GTK+tobac2.exe -len')

Voila: every word is English now! The menu, the labels, the tooltips, the protocol, ...

If you still need more English, your help is welcome.
fxm
Posts: 9013
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Postby fxm » Dec 10, 2009 8:44

Where to get all the DLL called?
TJF
Posts: 3473
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Dec 10, 2009 8:59

fxm wrote:Where to get all the DLL called?

Have a look at ReadMe.txt:
Software requirements:

Freebasic (mind. 0.20) (http://www.freebasic.net)
Glade3 (http://sourceforge.net/project/showfiles.php?group_id=98754)
GTK+ >= 2.14 (http://sourceforge.net/project/showfiles.php?group_id=98754)
optional: an IDE like e.g. Geany

or google!
Galeon
Posts: 563
Joined: Apr 08, 2009 5:30
Location: Philippines
Contact:

Postby Galeon » Dec 10, 2009 10:20

You also integrated some functionalities of glade2fb? I could help you in your project if you want, I think that's better than sharing some code.
You may also create your own installer for Windows if you don't want people messing up with GTK+ libraries, you may use my installer, I will give you the NSIS sources if you want.
TJF
Posts: 3473
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Dec 10, 2009 10:52

Galeon wrote:You also integrated some functionalities of glade2fb?

Yes, see http://www.freebasic.net/forum/viewtopic.php?t=14606. Thanks again for publishing your code.

Do you agree: ProjectName, ProjectYear and ProjectVersion in not necassary as a user entry? What do you think about using separate files for callbacks?

Galeon wrote:I could help you in your project if you want, I think that's better than sharing some code.


Your help is welcome! I'm not keen on windows and I do not know the IDEs used there. So your code allready was a big help for me. Let's see what's coming next.

Galeon wrote:You may also create your own installer for Windows if you don't want people messing up with GTK+ libraries, you may use my installer, I will give you the NSIS sources if you want.


Thank you and welcome again! I'm not keen on installing issues. Feel free to create an installer for GTK+tobac2. How can I support?
TJF
Posts: 3473
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

GTK+tobac2 installer

Postby TJF » Dec 10, 2009 11:01

@Galeon:

PS: I made some smaller changes today. If you make an installer I'll serve the latest version.
Galeon
Posts: 563
Joined: Apr 08, 2009 5:30
Location: Philippines
Contact:

Postby Galeon » Dec 10, 2009 11:01

I'm fond of open source programs, so I release my own as open source.
I have Ubuntu Linux as my OS, but I also have MS Windows XP. If you don't like Windows but needs to test your program, install wine in Linux. GTK+ doesn't work in the 1.0 release, I use the wine1.2 package in Ubuntu.
Those year, version, etc. changes often, you need to add some code to change them if you need those.
I think it is good to have each signals a separate file, but using the signal name will make the file name very long.
Galeon
Posts: 563
Joined: Apr 08, 2009 5:30
Location: Philippines
Contact:

Postby Galeon » Dec 10, 2009 11:05

I would if you want, I will release it tomorrow, if I'm not busy tonight.
TJF
Posts: 3473
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Dec 10, 2009 11:11

Galeon wrote:I think it is good to have each signals a separate file, but using the signal name will make the file name very long.


This depends on the widget names. I had no problem since I use GTK+tobac. As I know, file names can be up to about 250 characters?!

OK, I like short names.
Galeon
Posts: 563
Joined: Apr 08, 2009 5:30
Location: Philippines
Contact:

Postby Galeon » Dec 10, 2009 11:15

TJF wrote:
Galeon wrote:I think it is good to have each signals a separate file, but using the signal name will make the file name very long.


This depends on the widget names. I had no problem since I use GTK+tobac. As I know, file names can be up to about 250 characters?!

OK, I like short names.


If you have a good parser, use widget names. You may use lfn, but the users may not like that.
TJF
Posts: 3473
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

GTK+tobac installer

Postby TJF » Dec 13, 2009 13:25

Galeon wrote:I would if you want, I will release it tomorrow, if I'm not busy tonight.


Galeon seemed to be very 'busy' that night! So I made a guide how to test GTK+tobac2 on windows. See the first post!
Galeon
Posts: 563
Joined: Apr 08, 2009 5:30
Location: Philippines
Contact:

Re: GTK+tobac installer

Postby Galeon » Dec 14, 2009 10:25

TJF wrote:
Galeon wrote:I would if you want, I will release it tomorrow, if I'm not busy tonight.


Galeon seemed to be very 'busy' that night! So I made a guide how to test GTK+tobac2 on windows. See the first post!


I have finished the installer, its just not working on the translations which is not working.
Here is the link:
http://www.galeon.exofire.net/projects/installers/GTK+tobac2-2.0.0.0.exe
Sources of installer:
http://www.galeon.exofire.net/projects/installers/GTK+tobac2-installer-source.tar.gz

You have not provided a logo with your program, you can edit the images used in the program from the sources of the installer. I have used the images from my own program.

You may also translate it to your own language, just fill this:

Code: Select all

  LangString TEXT_INSTTYPE1         ${LANG_GERMAN}      "Full"
  LangString TEXT_INSTTYPE2         ${LANG_GERMAN}      "Minimal"
  LangString TEXT_FINISHPAGE_README   ${LANG_GERMAN}      "Show $(PRODUCT_README)"
  LangString TEXT_FINISHPAGE_START   ${LANG_GERMAN}      "Start ${PRODUCT_REGISTRY_KEY}"
  LangString DESC_SecCore         ${LANG_GERMAN}      "Core program files."
  LangString DESC_SecGrpGTKp      ${LANG_GERMAN}      "GTK+ related files. Install if you don't have GTK+ installed."
  LangString DESC_SecGTKCore      ${LANG_GERMAN}      "Core libraries for GTK+."
  LangString DESC_SecGTKGlade      ${LANG_GERMAN}      "Glade library."
  LangString DESC_SecGTKMSW32Theme   ${LANG_GERMAN}      "Use your current theme in Microsoft Windows as application's theme."
  LangString DESC_SecGrpLic         ${LANG_GERMAN}      "Different license notices that you can use in your program."
  LangString DESC_SecLicGNUGPL3      ${LANG_GERMAN}      "The newest version of the General Public License."
  LangString DESC_SecLicGNUGPL2      ${LANG_GERMAN}      "Currently the most popular version of the General Public License."
  LangString DESC_SecLicGNULGPL21   ${LANG_GERMAN}      "Less restrictive General Public License version 3, commonly used for libraries."
  LangString DESC_SecLicGNULGPL2   ${LANG_GERMAN}      "Less restrictive General Public License version 2, commonly used for libraries."
  LangString DESC_SecLicBSD         ${LANG_GERMAN}      "BSD License is one of the most widely used licenses."
  LangString DESC_SecLicZlib      ${LANG_GERMAN}      "Zlib License is one of the most widely used licenses."
  LangString DESC_SecLicApache20   ${LANG_GERMAN}      "Apache's license."
  LangString DESC_SecLicFreeware   ${LANG_GERMAN}      "A common license notice for Freeware programs."


I'm also creating an installer for Glade, using only 30+mb, than glade's 110+, but including the translations so you could still use it in German, etc.
TJF
Posts: 3473
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

GTK+tobac installer

Postby TJF » Dec 14, 2009 20:19

@Galeon: Well done! Look and feel is realy good. Nice picture and icon!

If you don't matter, I'll use your icon in the next version.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 7 guests