Questions tagged [gtk3]

The GIMP ToolKit (GTK+) in its version 3.x. GTK+ is a highly usable, feature-rich toolkit for creating graphical user interfaces (GUIs) that boasts cross platform compatibility and an easy to use API.

GTK+ is written in C, but has bindings to many other popular programming languages such as C++ (), Python (), and C# 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.

The latest version is GTK+ 3, released in January, 2011.

For questions not specifically regarding GTK 3, please use instead.

Reference documentation in C

Reference documentation in Python

3219 questions
10
votes
1 answer

How to make a Gtk+3 window full screen?

I'm looking for a functional example that would demonstrate how to make a Gtk+3 window full screen.
yPhil
  • 8,049
  • 4
  • 57
  • 83
10
votes
1 answer

Java Swing application under Gnome - use Adwaita (dark skin) window title bar

Is there a way for a Java Swing desktop application that runs in Gnome (3.14) on Linux (Debian) to make Gnome use the dark-themed (Adwaita) version of the window decoration? I am using a custom dark Swing look-and-feel, and the only thing that is…
0__
  • 66,707
  • 21
  • 171
  • 266
10
votes
1 answer

Gtk3 TextBuffer.serialize() returns text with format tags, even when there is visually none

I'm working with a Gtk TextView/TextBuffer in my project where the user is able to type in rich text (bold/italic/underline) by selecting the correct toggle buttons. The problem is that if I apply the underline or italic Pango flag to text within…
RPiAwesomeness
  • 5,009
  • 10
  • 34
  • 52
10
votes
3 answers

Install Gtk 3 for python on mac

I have installed python gtk3 using homebrew but it prints Warning: gtk+3-3.14.6 already installed but when i try to import it in python from gi.repository import Gtk it gives the error ImportError: No module named gi.repository Please help.
Kritesh Semwal
  • 163
  • 1
  • 1
  • 8
10
votes
2 answers

Gtk+ icon missing when running in MS Windows

I have a C/GTK+ application developed on Ubuntu, and I want to cross-compile it so that it runs on MS Windows. I followed this guide to set up the compiler, and the program was compiled successfully, and it runs on MS Windows. However, the icons on…
user12205
  • 2,684
  • 1
  • 20
  • 40
10
votes
2 answers

How to create a PixBuf from file with Gdk3?

Environment: Python3 Libraries: from gi.repository import Gtk, Gdk import cairo I want to create a 'pixbuf from file' but the method does not longer exist in Gdk3. pb = Gdk.pixbuf_new_from_file('sunshine.png') Gdk.cairo_set_source_pixbuf(cr, pb, 0,…
user2399377
  • 101
  • 1
  • 5
10
votes
1 answer

Multitouch GTK3 Example

From what I understand, multitouch support was added to GTK+ as of version 3.4. What I'm not clear on is whether this applies just to touch screens like phones/tablets or whether it extends to Apple style touch pads (the way Ubuntu/Unity and OS X…
gregghz
  • 3,925
  • 7
  • 40
  • 69
10
votes
1 answer

GTK+ 3.0: How to use a Gtk.TreeStore with custom model items?

I'm trying to develop a GTK application in Python and I'm really stuck with the correct usage of a gtk.TreeStore. My main problem: I've already parsed some JSON and I have my own data structure which ist basically a Python list and two kinds of…
f4lco
  • 3,728
  • 5
  • 28
  • 53
10
votes
2 answers

How to draw a GdkPixbuf using GTK3 and PyGObject

I have a small application that uses a DrawingArea to draw a simple map using PyGObject and GTK3. I load a Pixbuf using from gi.repository import Gtk, GdkPixbuf pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size("logo.png", 25, 25) and then try to…
gnirx
  • 197
  • 1
  • 1
  • 8
9
votes
1 answer

How do I prevent a GtkAspectFrame from wasting space?

horizontal
Will
  • 2,014
  • 2
  • 19
  • 42
9
votes
2 answers

pango attributes with pygobject

I have the following code, that uses pygtk: attr = pango.AttrList() attr.change(pango.AttrSize(( 50 * window_height / 100) * 1000, 0, -1)) attr.change(pango.AttrFamily("Sans", 0, -1)) attr.change(pango.AttrWeight(pango.WEIGHT_BOLD, 0,…
Marco Biscaro
  • 1,208
  • 10
  • 17
9
votes
1 answer

How to get Gdk window from xid?

I'm lost in version 3.. in python2+gdk2 is: #!/usr/bin/env python2 import gtk gtk.gdk.window_process_all_updates() window_xid = 54525964 gdk_window = gtk.gdk.window_foreign_new(window_xid) which is pretty much straight forward. But then, the…
demula
  • 1,214
  • 2
  • 9
  • 12
9
votes
2 answers

How to use CssStyleProvider in Gtkmm3

I'm programming in c++ with gtkmm3. I want to change some fonts in my program. I read all the things about CssStyleProvider, StyleContext in gtkmm documentation and also in gtk+ documentaion but i couldn't make it work and couldn't find any tutorial…
Gökhan Uras
  • 181
  • 1
  • 6
9
votes
1 answer

How to handle double-click events in GTK+3?

I was wondering how to produce double clicks? Take the following code that draws lines using single clicks http://zetcode.com/gfx/cairo/basicdrawing/: #include #include static void do_drawing(cairo_t *); struct { int…
PintoDoido
  • 1,011
  • 16
  • 35
9
votes
2 answers

GTK: get rid of the system theme/CSS altogether

GTK3 applications can be styled and themed with CSS. How can I force GTK to use solely the CSS shipped with my application, instead of combining / cascading it with the theme installed on the user's system? Why would one want to do that? In theory,…
Ichthyo
  • 8,038
  • 2
  • 26
  • 32