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

Ending the GTK+ main loop in an Python MDI application

I am trying to code an application that consists of various windows (e.g., generic message dialog, login dialog, main interface, etc.) and am having trouble getting the gtk.main_quit function to be called: either I get a complaint about the call…
Xophmeister
  • 8,884
  • 4
  • 44
  • 87
3
votes
2 answers

How to copy the GTK style of a widget and apply it to another?

My current GTK popups look like this - note it takes the dark ambiance colour theme. In GTK3.8 and later there are GTKMenuButtons - the popup looks like this - note it looks like it uses the button styling cues. I like this style and I want my…
fossfreedom
  • 2,903
  • 2
  • 19
  • 40
3
votes
2 answers

How to generate a .so file

I am writing an extension for the Scratch text editor application on Elementary OS Luna. But the documentation is practically non-existent for extension creation and I have no idea how to proceed after writing my main code for the extension. I've…
uSeRnAmEhAhAhAhAhA
  • 2,527
  • 6
  • 39
  • 64
3
votes
1 answer

Handling spreadsheet data through the clipboard in GTK

I'm using a GtkSheet widget in PyGTK to power my application's spreadsheet, and it gives me an API to pull and push data out of cells. (I looked at using GtkTreeView, but it seemed to be too much work) What I don't understand is how to intercept…
lfaraone
  • 49,562
  • 17
  • 52
  • 70
3
votes
0 answers

How to remove highlight from entry in pygtk?

i have a small GUI that i created, and when it fires up, the 'first' gtk.Entry that i have created is always highlighted (in a series of entries). essentially, here is how i create it: my_entry =…
jasonmclose
  • 1,667
  • 4
  • 22
  • 38
3
votes
2 answers

gtklist[c code]: how to get the selection of a GtkList

Followed is the code referring to very old gtk+1.x FAQ. The purpose is to get the selection of a GtkList. I know GtkList is deprecated and should be replaced with GtkTreeView + GtkListStore. I do know how to use GtkListStore. However, I do want to…
warem
  • 1,471
  • 2
  • 14
  • 21
3
votes
1 answer

how to get entry field as a password (*) in notebook tab pygtk

I have used gtk.Notebook() in my script, In notebook tab I have given 2 text fields username and password but problem is that the entry field does not behave as password field, it is showing character. so I want if i type password it should be…
Ashish Jain
  • 760
  • 1
  • 8
  • 23
3
votes
1 answer

In Gtk#, how do I reset a timer that was set with GLib.Timeout.Add?

I'd like to save the state of a widget once it has not been editted for 2 seconds. Right now, my code looks something like this: bool timerActive = false; ... widget.Changed += delegate { if (timerActive) return; timerActive =…
Matthew
  • 28,056
  • 26
  • 104
  • 170
3
votes
3 answers

How do I make a Gtk.Frame's label bold?

Usually, for Labels you can do something like this: Label label = new Label ("Some Text") { UseMarkup = true }; However, Gtk.Frame's label is just a string, not a full-fledged Label. I can't find an option to use markup. How to I enable…
Matthew
  • 28,056
  • 26
  • 104
  • 170
3
votes
2 answers

What does "GLib-GObject-WARNING **: instance with invalid (NULL) class pointer" mean?

Whenever I close my Gtk# application, I get this: (/home/matthew/opensbs/OpenSBS/bin/Debug/OpenSBS.exe:5050): GLib-WARNING **: g_set_prgname() called multiple times (/home/matthew/opensbs/OpenSBS/bin/Debug/OpenSBS.exe:5050): GLib-GObject-WARNING…
Matthew
  • 28,056
  • 26
  • 104
  • 170
3
votes
2 answers

In Gtk, when is it better to use Glade/GtkBuilder than native code?

Glade helped me get started on a project quickly, but I've found it harder to maintain in the long run, and I'm thinking about switching it all to native code. In what circumstances would you choose glade, and when would you use native code?
Matthew
  • 28,056
  • 26
  • 104
  • 170
3
votes
1 answer

Python - how to make transparent window with gtk.Window but not with Gtk.Window?

How to make gtk.Window ( Not with import Gtk, Gtk.Window i mean ) transparent? for example doing this same with import gtk, gtk.Window ? #!/usr/bin/env python import cairo from gi.repository import Gtk, Gdk class MyWin (Gtk.Window): def…
user285594
3
votes
1 answer

Get the class structure instance of a GObject type

How do I get a class object of a certain class in GObject / Gtk? For example, if my class is GtkSpinButton, I want to get the instance of GtkSpinButtonClass that represents the class. It is the parameter "class" in gtk_spin_button_class_init…
jdm
  • 9,470
  • 12
  • 58
  • 110
3
votes
3 answers

Compiling and running GTK+ application on Windows 7

System: Windows7, 32 bit, GTK 2.24.10, mingw I am trying to write basic helloworld.c type GTK based application. However, it doesn't run. These are the steps which I followed. Install MinGW. Download GTK+ all in one bundle. Extract content in…
msinfo
  • 1,147
  • 6
  • 21
  • 39
3
votes
2 answers

Gtk+ File handling with C

Does anyone know file handling using GTK. I need to open a file in "w+" mode and write to it. I dont know if file handling exists in GTK. Below is a sample 'C' program that I need in GTK format. #include int main(int argc, char *argv[])…
AhmetHani
  • 33
  • 3
1 2 3
99
100