Questions tagged [gtk2]

The GIMP ToolKit (GTK+) in its version 2.x.

The GIMP ToolKit (GTK+) in its version 2.x. For questions that do not specifically address GTK2, use .

484 questions
4
votes
1 answer

In PyGTK, what is a simple way to show a PNG file?

The following PyGTK code displays a PNG file in a window. Is there a simpler or better way of displaying the PNG file, like, by using a gtk.DrawingArea? For example, how do you resize the file? import gtk import pygtk pygtk.require('2.0') class…
Winston C. Yang
  • 1,497
  • 2
  • 18
  • 27
4
votes
1 answer

GTK+ Use one handler for multiple widgets

I have a callback function as follows: void handle(GtkWidget *widget, gpointer data) {...} Since I have a lot of widgets for this window, I would like to use this callback as the only handler to avoid writing a bunch of small functions. Initially I…
jeanluc
  • 1,608
  • 1
  • 14
  • 28
4
votes
2 answers

Is it possible to set the color of a ScrollWindow?

I have the following code,: GdkColor color; color.red = 0x0; color.green = 0x0; color.blue = 0x0; gtk_init (&argc, &argv); window = gtk_dialog_new (); gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &color); g_signal_connect (window, "destroy",…
user7537486
4
votes
0 answers

OpenCV Crosscompile for ARM: highgui error (GTK2+)

I'm have build the OpenCV library from source for Zynq (ARM). But, OpenCV was build on the same PC for x86 (PC) also. Firstly, I can execute every example on my PC without any issues. Secondly, I am able to crosscompile and execute every program on…
pank1t
  • 41
  • 2
4
votes
1 answer

How to receive characters from input method in gtk+2?

I'm creating a application using C & gtk+2 with custom text input, pango to draw the characters to GtkDrawingArea, everything works fine until a user tells me that he can't input Chinese characters in my application, he use a fcitx input…
Learning
  • 305
  • 1
  • 13
4
votes
1 answer

Is it possible to add private data to a GtkWidget?

Is it possible to add private data to a GtkWidget? Background: I have many GtkCheckBottons, all these widgets are connected to the same callback. In the callback, I would like to handle the widgets private data (or at least distinguish between the…
sergej
  • 17,147
  • 6
  • 52
  • 89
4
votes
1 answer

gtk label text center and wrap

I have been experiencing some really weird problems with gtk_label text positioning. I have a gtk_label positioned on a fixed container, the label has been set to: gtk_label_set_justify(GTK_LABEL(label),…
4
votes
2 answers

An overlay GTK toolbar/widget

I am writing a custom application in C using GTK+2.0 and Cairo. Just for learning purposes (and if successful, then for deployment), I wish to recreate something similar to a overlay toolbar/widget (I am sorry if the terminology is not correct) that…
Chatter
  • 193
  • 8
4
votes
2 answers

How to disable destroy when escape is pressed in a GtkDialog in gtk?

I made a GtkDialog object, but I want to disable or handle the escape press event, how can I do it?
ssoto
  • 469
  • 5
  • 19
4
votes
2 answers

GtkToolButton with custom icon but of stock icon size

I've a GtkToolBar which has say 3 GtkToolButtons with each of these having a stock icon value, and hence they all appear in the same size; now I added a 4th GtkToolButton with a custom image (.png), which was of an arbitrary dimension and only this…
legends2k
  • 31,634
  • 25
  • 118
  • 222
3
votes
0 answers

can Ruby GTK::StatusIcon use to find existing systray icon?

I try to automate right clicking windows systemtray icon using ruby. After searching on web, I find GTK::StatusIcon can be used to create NEW systray icon and menu, etc. However, I didn't find a way to identify current/existing icons. From searching…
3
votes
3 answers

Getting WebKit bindings to work with Perl and gkt2

I need to use WebKit in my perl + gtk2 application. Found a package Gtk2::WebKit on CPAN, but can't get it working. cpan> install Gtk2::WebKit gives following output: Package webkit-1.0 was not found in the pkg-config search path. Perhaps you…
Karol Buczel
  • 65
  • 1
  • 5
3
votes
3 answers

PyGTK: access buttons in gtk.MessageDialog?

I have a function that creates prompts using gtk.MessageDialog in PyGTK. How could I access the predefined buttons? Or would I need to manually construct a gtk.Dialog? I'd rather not, seeing as MessageDialog is a convenience function. The…
soren121
  • 368
  • 3
  • 16
3
votes
1 answer

Sending XKeyEvent to gtk3 applications

I used following documentation to write a method in Vala to send key press events (e.g. V) to the application which has the focus. Here is the code: public void press(string accelerator) { X.KeyEvent key_event; …
Oliver Sauder
  • 1,124
  • 12
  • 29
3
votes
3 answers

Detect which key is pressed in C

I'm trying to find a way to find out which key is pressed down in C. This will be in a graphical environment, written in GTK2, but I don't think the answer lies there. I think I might be able to do this using Xlib, but I haven't been able to find…
Sinthet
  • 873
  • 2
  • 8
  • 13
1 2
3
32 33