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
6
votes
1 answer

default arguments removed in gtk3?

I try to port my pygtk code to gtk3. I get this error: TypeError: pack_start() takes exactly 5 argument(s) (2 given) It seams that the default arguments have been removed. Does gtk3 (accessed from python) not support default arguments? Since the…
guettli
  • 25,042
  • 81
  • 346
  • 663
6
votes
1 answer

Explain how works Drag 'n Drop on GTK+3.0

For about two weeks I have been studying GTK +3.0. I want to make a good desktop application, but increasingly find GTK, more cryptic, I have always developed for the web, a little more than six months android development and I have a year of…
rkmax
  • 17,633
  • 23
  • 91
  • 176
6
votes
2 answers

How to use a custom font in a GTK app

I have a font file /path/to/app/fonts/custom-font.ttf and I want to use it. How do you import a custom TTF for use in a GTK+3.0 app? from gi.repository import Gtk, Pango # ... lbl = Gtk.Label() lbl.modify_font(Pango.FontDescription("sans 48")) #…
rkmax
  • 17,633
  • 23
  • 91
  • 176
6
votes
1 answer

How to write custom Gtk.CellRenderer in python and GTK 3?

i must write my own cell renderer with button, i came up with this: #!/usr/bin/env python3 from gi.repository import Gtk class CellRendererButton(Gtk.CellRenderer): def __init__(self): Gtk.CellRenderer.__init__(self) def…
BPS
  • 1,133
  • 1
  • 17
  • 38
6
votes
2 answers

How to add keybindings to a gtk3 application?

I'm trying to add keybindings to a gtk3 application via css. This is what I have so far: // add style provider GtkCssProvider *css = gtk_css_provider_new(); …
luksen
  • 61
  • 1
6
votes
1 answer

GTK 3 - Popup menu to expand after adding items to it

I'm using GTK 3.4 with python (with GObject introspection). I have pop-up menu build with Gtk.UIManager, some menu items are not active/visible when menu is instantiated. Later they are activated and they became visible in the menu. However…
Ivan
  • 960
  • 7
  • 15
6
votes
1 answer

How to get clipboard content in GTK3 (GI) and Python 3 on Ubuntu

In Python 2, with what's installed in my machine (Ubuntu 12.10), I can do import gtk cb = gtk.clipboard_get() content = cb.wait_for_text() to get the text from the clipboard. In Python3, however, I was supposed to do the same with the…
Pablo
  • 652
  • 6
  • 21
6
votes
3 answers

How to integrate Python's GTK with gevent?

Gtk is a GUI toolkit with bindings to Python. Gevent is a Python networking library built on top of libevent (libev on newer versions) and greenlets, allowing the usage of network functions inside greenlets without blocking the whole process. Both…
lvella
  • 12,754
  • 11
  • 54
  • 106
6
votes
3 answers

Background of custom GTK widget is rendered solid black

I am trying to create a custom widget in GTK 3. I noticed drawing problems which only appear with certain GTK themes, while all other themes work great. I narrowed down the problem to the code that draws the background by calling…
dasup
  • 3,815
  • 1
  • 16
  • 25
6
votes
1 answer

GNOME/Vala application to run on Windows

I want to port my C# WinForms application to be usable both with Windows and Linux. I have some experience with Java and more experience with Python but I don't really like the first and I'm concerned with the second (I mean the obfuscation, need to…
smsware
  • 429
  • 1
  • 13
  • 41
6
votes
1 answer

How do you implement help (using mallard) for a gtk3 app?

I am trying to create my own gtk3 application. I like to use mallard to display some help about how to use my application. However I do not know how to code such that when the help menu item is clicked the help (mallard) is shown. I have the .page…
Nik
  • 759
  • 3
  • 10
  • 24
6
votes
1 answer

How do I set a Gtk.StatusIcon as Text

I'd like to create a Gtk.StatusIcon with custom text. Ideally I'd like to append this to an existing image, but text-only is ok, too. How can I achieve this? I've seen some posts about getting a Gtk.Label's pixbuf but those methods seem to be…
Massless
  • 151
  • 1
  • 3
6
votes
2 answers

Is there a way to get code-hints for gtk3 and python working on aptana?

My situation is Aptana eclipse plug-in installed and working properly. If I from gi.repository import Gtk the code completion I'm used to from import gtk is gone. Any solutions or is it just a bug? My interim solution is keeping an import…
RobotHumans
  • 807
  • 10
  • 25
5
votes
1 answer

Window doesn't show in python interpreter in GTK3 without Gtk.main()

In GTK2, I enjoyed building a gui in the interpreter (ipython or plain python) "on the fly" and seeing the changes in real time like this: >>> import gtk >>> win = gtk.Window() >>> win.connect('delete-event', gtk.main_quit) 10L >>>…
narnie
  • 1,742
  • 1
  • 18
  • 34
5
votes
1 answer

Text changed signal for Text View widget in GTK3

How can I find out when the text has been changed in a text view widget in the GTK3 framework? I think there must be a signal associated with it, but could not find it. For example, there is an ontextchanged signal in qt4, so there should be a…
Gaurav Sood
  • 157
  • 3
  • 16