Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

starting with GTK+ on Ubuntu [closed]

I am just beginning with GTK+.

I have an Ubuntu 11.04. How should I install the GTK and which stable version?

The GTK website offers packages for download. However there are 4 other supporting packages. I was wondering if I can us sudo apt-get or synaptic to download them. When I typed GTK on Synaptic there is a long list though.

Please suggest a stable GTK version available for download using sudo apt-get.

Also, what IDE should I use for development and simulation?

I have been programming with Qt till now which had the QtCreator, QtDesigner for this purpose. My Application has to now be ported on GTK. I googled to find out no translator engine for Qt to GTK.

Did any of you have this experience?

Thanks

like image 939
user907810 Avatar asked May 11 '12 09:05

user907810


People also ask

How do I install GTK+ on Ubuntu?

Summary 1 Install GTK+ Library Dependencies First, install GTK3 libraries: $ sudo apt-get install libgtk-3-dev 2 Install C Compiler Second, you should have a C compiler: $ sudo apt-get install gcc 3 Install Geany Text Editor Then install Geany IDE: $ sudo apt-get install geany More items...

What is GTK+ library in Linux?

With GTK+ library, you can develop programs with user interface on GNU/Linux (and other platforms, too). An example of greatest thing ever developed with GTK+ is GNOME Desktop Environment. Like in the previous tutorial, here you will also use Geany IDE to write source code.

Should I learn C or GTK for Ubuntu development?

Second I'd very much advise you to focus on C++ and Qt instead of C and GTK. Qt is a great cross-platform framework that uses C++ and QML (a JavaScript-like language for UI), and Ubuntu is moving more and more towards using Qt for their future desktop and mobile development.

How do I get Started with GTK?

To begin our introduction to GTK, we’ll start with a very simple application. This program will create an empty 200 × 200 pixel window. Create a new file with the following content named example-0.c.


2 Answers

You can install two different versions (2.24.10, 3.4.1) of GTK+ on Ubuntu (precise).

sudo apt-get install libgtk2.0-dev
sudo apt-get install libgtk-3-dev

Examples and demo application can be installed by the following commands

sudo apt-get install gtk2.0-examples
sudo apt-get install gtk-3-examples

There is no IDE like QtCreator in case of Qt, but there is a user interface builder named Glade.

sudo apt-get install glade
like image 91
Szilárd Pfeiffer Avatar answered Sep 25 '22 06:09

Szilárd Pfeiffer


If your background is Qt, which is a C++ API, you should probably go straight for gtkmm, which is the official C++ bindings for GTK+. This is needed since at heart, GTK+ is a C API, which relies on bindings to make the toolkit available in other programming languages than C.

I would not expect there to be a 1:1 translation tool, either, so your porting might become quite labor-intensive. I hope you don't need to continue to support the Qt version, too.

Also, this question seems to be relevant, and have good answers that seem worth reading for someone in your position.

like image 33
unwind Avatar answered Sep 25 '22 06:09

unwind