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

Change the label of GtkButton

I want to be able to change the label of a GtkButton after the widget has been shown char *ButtonStance == "Connect"; GtkWidget *EntryButton = gtk_button_new_with_label(ButtonStance); gtk_box_pack_start(GTK_BOX(ButtonVbox), EntryButton, TRUE, TRUE,…
paultop6
  • 3,691
  • 4
  • 29
  • 37
3
votes
2 answers

GTK+ call function every x second

So I am working on writing a gui for an existing c application. the gui is just a simple interface which would only display and not really feed back any information into the application. But I need to check a linked list if some new information is…
rowan.G
  • 717
  • 7
  • 13
3
votes
2 answers

Problems compiling libjingle/gtk+-2.0 for Mac OS X

I'm trying to compile libjingle on Mac OSX Snow Leopard. The INSTALL file said to './configure', 'make' and 'make install', as usual. But make fails for me. Initially it gave some messages indicating that I didn't have pkg-config installed (I guess…
mindthief
  • 12,755
  • 14
  • 57
  • 61
3
votes
4 answers

What's the difference between gtk_box_pack_start and gtk_container_add?

It seems to me that both functions can be used to add some widget to the container. What's the difference?
user198729
  • 61,774
  • 108
  • 250
  • 348
3
votes
1 answer

Error importing gi

This is the command I am trying to run and its output: $ python2 Python 2.7.8 (default, Sep 24 2014, 18:26:21) [GCC 4.9.1 20140903 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import…
abchk1234
  • 265
  • 1
  • 5
  • 14
3
votes
1 answer

What themes does GTK+ provide by default?

I want to change the default GTK theme for Windows. I know how to do that: by modifying the settings.ini file, or like this: settings = gtk_settings_get_default(); gtk_settings_set_string_property(settings, "gtk-theme-name", "ThemeName", NULL); the…
younes zeboudj
  • 856
  • 12
  • 22
3
votes
2 answers

How do I link gtk library more easily with cmake in windows?

I'm now doing it in a very ugly way by manually including all the required path(the gtk bundle is at D:/Tools/gtk+-bundle_2.20.0-20100406_win32): include_directories(D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/gtk-2.0…
Gtker
  • 2,237
  • 9
  • 29
  • 37
3
votes
1 answer

How to intergrate PDF viewer(display) in the GTK+ interface

Am working on the project in which am required to fetch files from the server and to display them on the client post.All of this is to be done in the UNIX environment where I used C language for coding client and server and GTK+ for the interface…
user3557777
  • 133
  • 1
  • 4
  • 15
3
votes
1 answer

How to tell whether a font is monospace using GTK and Pango?

I have a PangoFontDescription and I want to know whether it describes a monospace font. I have seen the function pango_font_family_is_monospace() in the Pango API documentation but after several hours of puzzling it is still not clear to me what…
ptomato
  • 56,175
  • 13
  • 112
  • 165
3
votes
1 answer

GTK+ 3.0 "No application is registered as handling this file"

I'm trying to create an about dialog in my GTK application. The following error appears when I click a link to website: Could not show link No application is registered as handling this file Here is the code: GtkWidget *dialog =…
3
votes
1 answer

How to create a clipboard object in GTK using JavaScript

I'm having a dickens of a time creating a clipboard object in JavaScript. const Gtk = imports.gi.Gtk; const Gdk = imports.gi.Gdk; // A bunch of unimportant code var clippy = Gtk.Clipboard.get(Gdk.Atom.intern("CLIPBOARD", false)); // Hi…
Blake
  • 308
  • 3
  • 11
3
votes
1 answer

Change the colour of pixels in a GdkPixbuf (GTK3)

I'm using Gtk.StatusIcon, and want to change the colour of some pixels; I have a working piece of code, this loads a 1x1 pixel PNG file with the colour I want to set, and then copies that to thhe icon Pixbuf. While this works, it has the obvious…
Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
3
votes
1 answer

How can I use CSS styling in my GTK# application?

How can I use CSS styling in my GTK# application? I heard before that it is impossible to use CSS themes in GTK#, but after that I found this example of using css styling in GTK#. Besides this I found also the samples of using CSS styling in Banshee…
konstantin_doncov
  • 2,725
  • 4
  • 40
  • 100
3
votes
1 answer

how to get children of a notebook in gtk using C

I have a gtk window that contains a notebook. I want to get the children of the same. I am using following statement GList *children; notebook = GTK_WIDGET (gtk_builder_get_object (self->gui, "list_notebook")); children =…
user2550098
  • 163
  • 1
  • 13
3
votes
1 answer

GTK focus-out-event

I am showing a user a popup menu when they right click. According to the popup behaviour, I want to destroy the popup when it looses focus(when user clicks outside the popup window). For that I tried to connect the popup window to "focus-out-event",…