Questions tagged [gtk]

GTK (formerly GTK+) is a toolkit for creating graphical user interfaces (GUIs) with cross platform compatibility and an easy to use API.

GTK is written in C, and has bindings to many other popular programming languages such as C++ (), Python (, ), C# (), and Perl, among others. GTK+ is licensed under the GNU LGPL 2.1, allowing development of both free and proprietary software with GTK+ without any license fees or royalties.

"GTK" stands for GIMP Tool Kit. It was originally developed to serve as the widget set for The GIMP, the GNU Image Manipulation Program. In the intervening years its usage has expanded greatly.

This tag should be used for questions about GTK in general. For more specific questions regarding how a certain version works, use or .

Reference GTK 3 documentation: http://developer.gnome.org/gtk3/stable/

Reference GTK 2 documentation: http://developer.gnome.org/gtk2/stable/

GTK Java binding - http://java-gnome.sourceforge.net/

GTK 2 Perl binding - https://metacpan.org/pod/Gtk2

GTK 3 Perl binding - https://metacpan.org/pod/Gtk3

Books:

SO Chatroom:

8468 questions
3
votes
1 answer

clone a GtkWidget from glade so it will be reusable several times in application

I'm writing a Gtk+3 application in C. The user interface is built with glade. I created an independent GtkBox that should be used in several places in my application. When I try to use that GtkBox more then once I get the following…
ufk
  • 30,912
  • 70
  • 235
  • 386
3
votes
2 answers

connecting a function to a GtkAction

I'm trying to write a GTK+3 application using C. I created a glade file with an action that it's id is 'tracks_deck.add_empty_track'. i connected the action to a toolbar item and a menu item. the question is how do I connect a function to that…
ufk
  • 30,912
  • 70
  • 235
  • 386
3
votes
4 answers

How can I set my Java system look and feel for JNLP apps?

I am running Gnome on OpenSuse. As a result, my system look and feel is GTK+, which has numerous ugly problems (see some of them here). During development of my swing app, I can run the client from command line or IDE and specify VM parameter…
Timothy
  • 2,457
  • 19
  • 15
3
votes
0 answers

X11: invalid Alt/Meta key config? / GTK+: said key not mapped by gdk_keymap_add_virtual_modifiers()? / KDE: bogus complaint about key?

NOTE See the updates below; weirder things have come up now. I'm interpreting the GdkEvent***.state field in my various mouse event handlers as so: gdk_keymap_add_virtual_modifiers( gdk_keymap_get_for_display(gdk_window_get_display(e.window)), …
andlabs
  • 11,290
  • 1
  • 31
  • 52
3
votes
2 answers

GTK TextView tags to pango markup

I want to extract the formated text in a GtkTextView as html or pango markup language. Having a small text editor with formating like this. So the formating elements are simple , , etc. Is there a way to get the formated text from the TexView?
microo8
  • 3,568
  • 5
  • 37
  • 67
3
votes
1 answer

Vala Image click event. How to get coordination of click?

I try to catch coordination of click. I created Gtk.Window, EventBox and put Image in, connected some EventButton to button_press_event and connected to this signal some method. This method try to get x and y from EventButton object but they always…
VitalD
  • 33
  • 2
3
votes
1 answer

Cannot Compile GtkD project in Visual D

I'm using Visual Studio 2013, Visual D Version 0.3.37, Gtk+3.8, the latest GtkD and dmd-2.065.0, on Windows 7. I followed these instructions to build GtkD, and set up my compiler to compile it. In Visual Studio, I told VisualD to use the compiler…
Drago0661
  • 43
  • 3
3
votes
1 answer

render html page into gtkwindow

how can i render HTML page into gtkwindow? say, i already have a downloaded/written HTML page. i want to render the content of that page in my gtk application. how can i implement ?
ganapati
  • 625
  • 2
  • 12
  • 24
3
votes
2 answers

In Gtk, how do I search a ListStore for the row containing a particular value?

I have a ListStore modeling a list of Tags. This list may change apart from the ListStore. What I'd like to do is listen to the TagRemoved event in my TagList class, and remove the Tag from the ListStore when the event is triggered. However, I can't…
Matthew
  • 28,056
  • 26
  • 104
  • 170
3
votes
2 answers

Will the GTK+ timeout callbacks be called in strict time order?

When I add many different timeouts (with each intervall==0) in a thread, which is not the main thread (where gtk_main() resides)... g_timeout_add(0, func, NULL); ... will then the different func() callbacks occur in the same order I called the…
ulrichb
  • 19,610
  • 8
  • 73
  • 87
3
votes
1 answer

GTK+ CSS for one button

How to set color for one button in GTK+ GtkButton button8 { border-radius: 20; border-width: 1 1 1 1; font: Sans 16; color: black; background-image: -gtk-gradient (linear, left top, left bottom, …
ganeshredcobra
  • 1,881
  • 3
  • 28
  • 44
3
votes
2 answers

Error while compiling GTK+ app with g_rename func

I'm trying to use g_rename and compiler gives me strange message error: called object ‘rename’ is not a function for line in code if (g_rename(old_file_name, full_new_file_name) == -1) I don't understand why. I'm compiling with command cc -Wall…
XoR
  • 2,556
  • 4
  • 17
  • 15
3
votes
2 answers

Cairo.ImageSurface to Gdk.Pixbuf?

Attempting to create a Pixbuf from an ImageSurface, but all I get are black pixels. Any ideas? Cairo.ImageSurface surface = mysurface; int w = surface.Width; int h = surface.Height; Gdk.Pixmap pixmap = new Gdk.Pixmap(null, w, h, 24); using…
Doug Blank
  • 2,031
  • 18
  • 36
3
votes
0 answers

How to choose gtk version for Eclipse RCP application in linux?

I have an Eclipse RCP application which I want to run in Linux environment that has multiple gtks installed. Is there a way to choose the gtk version against which I can run the application? Linux flavour: openSUSE Window Manager: iceWM gtk versions…
gerin
  • 392
  • 1
  • 3
  • 11
3
votes
1 answer

Is there a system colors collection in GTK#?

How can I get a multi-platform system colors collection in GTK# (like System.Drawing.SystemColors in .NET)? I want an equivalent to System.Drawing.SystemColors.Control and System.Drawing.SystemColors.Highlight, ...
ulrichb
  • 19,610
  • 8
  • 73
  • 87