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
3
votes
0 answers

Handle X11 damage events in a GTK2 application

I am writing a GTK2 widget that shows images of all open windows. These images will update in real time. To do this, I will use the X11 Damage extension. As far as I understand, the first step is to register an interest in damage events for a given…
adlo
  • 63
  • 8
3
votes
2 answers

gnope for php-gtk2 is gone?

where can i download the gnope installer to have the php-gtk2 in my machine ?, according to the online manual, it is found at gnope.org, but I am being redirected to this tradebit website,
sasori
  • 5,249
  • 16
  • 86
  • 138
3
votes
2 answers

GTK+ 2 C - enter pressed or button clicked to get text from entry widget

what should I do to print text from entry when enter is pressed or button is clicked with one function? I am asking because when I am clicking at button I get "(PMAF:3592): Gtk-CRITICAL **: IA__gtk_entry_get_text: assertion 'GTK_IS_ENTRY (entry)'…
jjpikoov
  • 119
  • 1
  • 11
3
votes
2 answers

How to prevent widgets from expanding to whole box (GTK 2)

I'm having the following issue with GTK2: I created two buttons with labels inside an horizontal box. (I intend to pile several hboxes) However there's an issue: When I make the box_pack functions they go like…
Kelthar
  • 124
  • 9
3
votes
1 answer

Change the label of GtkButton

I want to be able to change the label of a GtkButton after the widget has been shown char *ButtonStance == "Connect"; GtkWidget *EntryButton = gtk_button_new_with_label(ButtonStance); gtk_box_pack_start(GTK_BOX(ButtonVbox), EntryButton, TRUE, TRUE,…
paultop6
  • 3,691
  • 4
  • 29
  • 37
3
votes
2 answers

How do I link gtk library more easily with cmake in windows?

I'm now doing it in a very ugly way by manually including all the required path(the gtk bundle is at D:/Tools/gtk+-bundle_2.20.0-20100406_win32): include_directories(D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/gtk-2.0…
Gtker
  • 2,237
  • 9
  • 29
  • 37
3
votes
1 answer

GTK apps show "green" too dark

Using Ubuntu 14.04 Trusty, for whatever reason some GTK apps show things that should should be "green" as a color that is very close (but not identical) to "dark green". Wasn't able to see anything strange in the gtk themes, or X11 rgb.txt. Several…
pieter3d
  • 135
  • 6
3
votes
2 answers

Cairo.ImageSurface to Gdk.Pixbuf?

Attempting to create a Pixbuf from an ImageSurface, but all I get are black pixels. Any ideas? Cairo.ImageSurface surface = mysurface; int w = surface.Width; int h = surface.Height; Gdk.Pixmap pixmap = new Gdk.Pixmap(null, w, h, 24); using…
Doug Blank
  • 2,031
  • 18
  • 36
3
votes
1 answer

How to create a cairo_t on a Gtk 2 window

I have an old app, now compiling on Gtk 2, but I need to introduce the use of Cairo. I can't figure out how to create the necessary cairo context (cairo_t) from my Widgets. Here's the code I'm trying to learn with so far, modified (*ahem* cribbed)…
4dummies
  • 759
  • 2
  • 9
  • 22
3
votes
1 answer

GtkScrolledWindow container sends its child a size allocation with a negative coordinate

I'm porting a custom Gtk+ widget from Gtk2 to Gtk3, and I'm observing that with the latter, I'm getting size_allocation calls from the parent widget (a GtkScrolledWindow) which have an allocation with a negative Y coordinate. This causes my widget…
knocte
  • 16,941
  • 11
  • 79
  • 125
3
votes
3 answers

Changing image on mouse click

I have been able to do the following: for (int i = 0; i < NUM_LEDS; ++i) { ledoff = gtk_image_new_from_file("./ledoff.png"); leds[i].pos=ledpos[i]; gtk_layout_put(GTK_LAYOUT(layout), ledoff, leds[i].pos.x, leds[i].pos.y); …
Dervin Thunk
  • 19,515
  • 28
  • 127
  • 217
3
votes
1 answer

How to allow clicking on a pixbuf (image) in a treeview?

I want to make my gtk.CellRendererPixbuf in the treeview clickable so that I can call a function when user clicks on it. Is this possible and how can this be done? I'm working with PyGTK, but answers in C or PHP or anything else would be acceptable.…
elwc
  • 1,197
  • 2
  • 15
  • 25
3
votes
2 answers

How to set ComboBoxEntry by default?

I have a ComboBoxEntry: my $com_entry = Gtk2::ComboBoxEntry->new($model, 0); and I need to delete the user entry from a ComboBoxEntry (to set an empty value). The method $com_entry->set_active_iter(undef); of ComboBox doesn't work. Any ideas?…
edem
  • 3,222
  • 3
  • 19
  • 45
3
votes
1 answer

Add overlay text to gstreamer video in Ruby

I have write this very simple video player that use gstreamer and gtk2 in Ruby. require 'gtk2' require 'gst' if ARGV.size != 1 puts "Usage: #{$0} " exit 0 end class VideoWidget < Gtk::DrawingArea def initialize(file) super() …
Pioz
  • 6,051
  • 4
  • 48
  • 67
3
votes
1 answer

Ruby-Gnome2 Notebook color

I'd like to be able to dynamically change the background color a notebook page in ruby-gnome2 after the program has run. I've only found ONE way of setting the background color: # Some page contents, for the sake of example box1 =…
KChaloux
  • 3,918
  • 6
  • 37
  • 52