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
3 answers

How to wake up the GUI thread in XCB?

My app is waiting on a thread to finish. When the thread finishes its thing, I want to update the GUI. The GUI thread is blocked in xcb_wait_for_event(). Is this possible with XCB? How does Qt, GTK, FLTK etc. implement this basic GUI problem in…
user519179
3
votes
1 answer

Thread-friendly main loop for GTK and nanomsg

How can I write a main loop which blocks while waiting for messages from multiple sources? As I understand it, the preferred way of writing an event-processing loop is to have it block while waiting for events. However, how can blocking be handled…
dhardy
  • 11,175
  • 7
  • 38
  • 46
3
votes
1 answer

Autostart of GTK application failing

I have a GTK application that runs perfectly when run from the desktop or a terminal window. I created a myprog.desktop file in ~/.config/autostart: [Desktop…
Julian Gold
  • 1,246
  • 2
  • 19
  • 40
3
votes
1 answer

Gtk "subtle" Progress Bar

I am wondering how to achieve a progressbar / loader indicator similiar to the one Epiphany (aka Gnome Web) is using. See the provided screenshot:
user4209617
3
votes
2 answers

Python GTK+ 3 pull up just a file chooser dialog?

I'm trying to create a program that uses the Gtk FileChooserDialog dialog. I followed the tutorial here, and it works. However, I would like to just have the dialog pop up and not have to deal with the actual Gtk window. I've tried taking the code…
RPiAwesomeness
  • 5,009
  • 10
  • 34
  • 52
3
votes
2 answers

What is the point of the _StructName convention in C?

After reading some source from the GTK+ library, I have encountered what I perceive to be a rather odd piece of code: typedef struct _GtkWidgetClass GtkWidgetClass; ... struct _GtkWidgetClass { ... }; What I don't understand about this code…
Levi
  • 1,921
  • 1
  • 14
  • 18
3
votes
0 answers

Overwrite or reset widget style in GTK3

I use the gnome-terminal which uses the vte library, which in turn provides the VteTerminal widget. Using an appropriate gtk.css file, I have added a padding around the VteTerminal widget. I embed the VteTerminal in a seperate GTK3 application,…
vprsm
  • 31
  • 1
3
votes
4 answers

Determining the mime type of a file

How can I determine the mime-type of a file (in OCaml)? I am trying to set the language for a GtkSourceView control, but to do that, I need to first determine the language. The only way I can see of doing this is using the mime-type - there is a…
a_m0d
  • 12,034
  • 15
  • 57
  • 79
3
votes
2 answers

Reporting library for Linux / C++ / Gtk?

We have a C++ Gtk application that currently has a "homebrew" reporting component. We're looking to step up to a more fully-featured reporting library, preferably with a WYSIWYG designer, print-preview / GUI viewer, and PDF export capabilities. Any…
Aidan Ryan
  • 11,389
  • 13
  • 54
  • 86
3
votes
0 answers

TreeView drag and drop in PyGObject: drag-data-delete not called?

I am working on an example how to do drag-and-drop in a TreeView in PyGObject. I have something I don't understand: Why is the drag_data_delete function never called? This is the self contained example: from gi.repository import Gtk, Gdk class…
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
3
votes
1 answer

How can I scroll a Clutter.ScrollActor with a scrollbar?

I have a a GtkClutter.Embed that holds a complete graph of clutter actors. The most important actor is container_actor that holds a variable number of actors (laid out with a FlowLayout) that may overflow the height allocated to the parent Embed. At…
Name is carl
  • 5,961
  • 3
  • 29
  • 44
3
votes
1 answer

GTK: Read-Only Text Entry (Label-Like)?

I need to make a gtk.Entry read-only like without using set_sensitive, specifically gtk_widget_set_sensitive will turn off all events, where as I'm only looking to make the entry clearly read-only, but to continue to receive signals. It also has to…
user3467349
  • 3,043
  • 4
  • 34
  • 61
3
votes
2 answers

What can I do with Seed?

I found Seed, which is basically a JavaScript environment and binding for programming GTK+. Are there any limitations compared to using e.g. C and C++? Are there any major speed concerns?
Delan Azabani
  • 79,602
  • 28
  • 170
  • 210
3
votes
2 answers

Trouble with jhbuild installation while running the command $ jhbuild sanitycheck

I am trying to learn GTK+3 as per this site: https://python-gtk-3-tutorial.readthedocs.org/en/latest/install.html. From the page: 1.1. Dependencies GTK+3 Python 2 (2.6 or later) or Python 3 (3.1 or later) gobject-introspection [...] The easiest…
Ajzz
  • 340
  • 1
  • 7
  • 22
3
votes
1 answer

How to resize a Gtk.Image in vala

I'm trying to resize a Image in vala. So I read valadoc and end up writing this code var img = new Gtk.Image.from_file ("fire.png"); var pix_buf = img.get_pixbuf (); pix_buf.scale_simple (50, 50, InterpType.BILINEAR); window.add (img); But it has…
Olivier Lasne
  • 679
  • 6
  • 12