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

Catching Haskell exceptions with gi-gtk and Reactive Banana

My application is bug-free, of course, but just in case it contains any bottom values I want to put in a generic exception catcher which will at least pop up a message box to tell the user what kind of bug to report. Because I'm using gi-gtk I…
Paul Johnson
  • 17,438
  • 3
  • 42
  • 59
9
votes
1 answer

how to style gtk widgets individually with css code

After this GTK+ change font to spin button and this how to apply CSS to GTK+ code? question, I started understanding how to apply a css style to a GTK code, yet there are still a lot confusing details. This is the code with which I create two…
user3060854
  • 923
  • 2
  • 15
  • 25
9
votes
1 answer

How to install GTK3 and minGW on Windows using MSYS2

I am a big fan of C and I just finished reading "C Programming Langauge 2nd Edition". I must admit it was a great book and I learned a lot of stuff. But the thing is, until now I was just making console apps, so I want to move on and create some GUI…
user3885884
  • 415
  • 3
  • 6
  • 13
9
votes
1 answer

How to use visibility of any widget on gtk?

I am new on GTK... I want to do hide the label at first and when I will click on the "click" button it will show the label.I used gtk_widget_hide(label)...bt it is not working.and will use fixed container don't change it. here is my code…
user
  • 143
  • 1
  • 8
9
votes
1 answer

Vala. How do you delete all the children of a GTK container?

Solved. See the reply for examples. I have a container with children. I need to delete all the children. This is easy in C. Vala does not work. The following code produces an error missing type argument for collection. var a_box = new Box…
user4845927
9
votes
1 answer

What is the non-deprecated way to display a stock icon in GTK3?

I'm assembling a GUI using PyGObject. This Python code works in context. I get a toolbar button with the stock "Open" icon. from gi.repository import Gtk # ... toolbar =…
aaaantoine
  • 900
  • 8
  • 19
9
votes
1 answer

Creating an installer for a python GTK3 application

I have just finished developing a Python 2.7 application using Gtk3 for GUI. My question is, how can I now create an installer for Windows, Mac, and Linux (possibly three different installers) for my end-users to easily download the application…
Noam Gal
  • 1,114
  • 2
  • 11
  • 20
9
votes
1 answer

Detect keypress when Gtk.Entry is in focus

I was trying to make a Entry widget that clears it's content when Esc is pressed. Here's what I've tried - class MyWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self) editor = Gtk.Entry() …
svineet
  • 1,859
  • 1
  • 17
  • 28
9
votes
0 answers

How to style GTK+ with custom CSS?

can someone type up a simple example for styling a GTK+ widget with css? I could not figure out how to do it looking at the docs: #include int main(int argc,char *argv[]) { gtk_init(&argc,&argv); GtkWidget *window; GtkWidget…
user1502482
  • 139
  • 1
  • 1
  • 4
9
votes
3 answers

What causes the different display behaviour for a GtkIconView between different GTK versions?

Pictures will explain the title: Under LMDE & Ubuntu 12.04 my GtkIconView looks like this - its correct in terms of the spacing between the icons: Under Ubuntu 12.10, 13.04 & Fedora 17 the same code displays as follows: N.B. - This is a rhythmbox…
fossfreedom
  • 2,903
  • 2
  • 19
  • 40
8
votes
3 answers

GtkTextView top/bottom margin?

I would like to know the correct and generally accepted way of adding a top and bottom margin to a GtkTextView that is inside of a GtkScrolledWindow. There are functions to set the left and right margin, which I am…
Sean Bright
  • 118,630
  • 17
  • 138
  • 146
8
votes
3 answers

Introspection on pygtk3 possible?

One of the great things of python is the ability to have introspection on methods and functions. As an example, to get the function signature of math.log you can (in ipython) run this: In [1]: math.log? Type: builtin_function_or_method Base…
xubuntix
  • 2,333
  • 18
  • 19
8
votes
1 answer

Placing Gtk.Widget in Box with top padding

I have a box like this: import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk [...] box_outer = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) box_outer.pack_start(Gtk.Label('Label1'), False, False,…
user1406177
  • 1,328
  • 2
  • 22
  • 36
8
votes
1 answer

Gtk.Image on HiDPI displays

I use a Gtk.Image backed by a GdkPixbuf.Pixbuf to display a photo. I scale the photo to fit the available space in response to the size-allocate signal of the parent widget. The problem is that on HiDPI displays, every dimension is in logical pixels…
Zoltan
  • 2,928
  • 11
  • 25
8
votes
4 answers

Gtk HeaderBar ActionBar pack_start pack_end within UI xml file

We are trialing Gtk3/Vala/Genie for the development of application user interfaces using Gnome-Builder/Meson/Glade/Flatpak. While there are many examples of Gtk.HeaderBar.pack_start( ... ) and Gtk.ActionBar.pack_start( ... ) within the Vala and…
AsymLabs
  • 933
  • 9
  • 15