gtk

How do I add items to a gtk.ComboBox created through glade at runtime?

I'm using Glade 3 to create a GtkBuilder file for a PyGTK app I'm working on. It's for managing bandwidth, so I have a gtk.ComboBox for selecting the network interface to track. How do I add strings to the ComboBox at runtime? This is what I have so far: self.tracked_interface = builder.get_object("tracked_interface") self.iface_list...

Tutorials/References/HowTos to learn Glade GTK+ with Ruby?

Hello all, I am trying to design some simple GUIs with Glade to use with Ruby. I am not having so much luck finding tutorials/references on how to actually interface glade with Ruby however. I have found maybe 1 or 2 hello world tutorials that show how to use a button to change a title of a window but is there a reference that tells me ...

How can I display an OpenCV IplImage in Gtk+/Gtkmm?

I've got images as IplImage that I want to display in a small Gtkmm application. How can I convert them to something Gtk can display? Solved: IplImage* image; cvCvtColor(image, image, CV_BGR2RGB); Glib::RefPtr<Gdk::Pixbuf> pixbuf = Gdk::Pixbuf::create_from_data( (guint8*)image->imageData, Gdk::COLORSPACE_RGB, false, image->dept...

How to cross-platform port unix pipes?

I have a code that looks like this: uses this library #include <unistd.h> #define READ_FD 0 #define WRITE_FD 1 int m_pipe[2]; if(pipe(m_pipe) != -1) { unsigned long Id = gdk_input_add(m_pipe[READ_FD], GDK_INPUT_READ, Callback, (gpointer)this); } and it surprisingly builds on both linux(all major flavors: AS3, AS5, solaris) an...

How to use anonymous pipes in windows api (and pass to gtk function)?

I need to be able to pass int value representing fd (pipe fd) to gtk function as a first parameter gint gdk_input_add gint source, GdkInputCondition condition, GdkInputFunction function, gpointer data); How do I do that, as CreatePipe returns HANDLE which is NOT int? Thanks ...

g_slice_new doesn't accept my struct type

that is how I build it: gcc pkg-config --cflags --libs gtk+-2.0 -o spawn spawn_with_pipes.c In the snippet of example below, I get an error: syntax error before "Data - it refers to data= g_slice_new(Data); #include <gtk/gtk.h> typedef struct { /* Buffers that will display output */ GtkTextBuffer *out; GtkTextBuffer *err...

how can I create pipe and pass to g_io_channel_win32_new_fd

I'm using gtk on windows and I need an ability to create a pipe for communication between processes via g_io_channel_win32_new_fd. How do you do that on windows? ...

GTK+ GTkStatusIcon not working in Win32

I cannot get GTkStatusIcon working in Windows and I get no errors. And I make a call to both gtk_status_icon_set_from_file and gtk_status_icon_new_from_file. Does anyone have any idea what could be causing this? I tried with .ico files and .png and still nothing... ...

How to change a GTK tree view style in Python?

I have an app written in python that presents some of its data in a tree view. By default, the tree view is a floaty white affair with little floaty triangles to expand the nodes. Is it possible to change this style to be more like a Windows explorer tree view? Specifically, I'd like to have vertical lines indicating parentage of the no...

How to make a Multiple-Select List Box in Ruby Glade/GTK, maybe using TreeView?

Hey guys, I am trying to make a multiple-select listbox in glade/ruby program and I am wondering how I go about doing this, like what element I add to the window and the corresponding example code I can use. I was looking at GTKList but it says it is deprecated now, and also I don't know how to get it working in ruby. GTK List docs say ...

pygtk: Draw lines onto a gtk.gdk.Pixbuf

I'm using pygtk with PIL. I've already figured out a way to convert PIL Images to gtk.gdk.Pixbufs. What I do to display the pixbuf is I create a gtk.gdk.Image, and then use img.set_from_pixbuf. I now want to draw a few lines onto this image. Apparently I need a Drawable to do that. I've started looking through the docs but already I have...

How to add GtkMozEmbed browser into a tab with Ruby/Glade/GtK?

Hey guys, I am trying to add a browser using GtkMozEmbed into a gui I am designing using Glade. I want the browser to take up a tab in a notebook widget, but I cannot figure out how to actually do this. I am wondering what container to use to put the browser in, and the associated ruby code to actually embed the browser in this contain...

How do I make an HTML file part of a MonoDevelop project?

The project is a GNOME aplication not a ASP.NET. I need to load a welcome.html file into the main page of the UI. Just like MonoDevelop does. But I dont know how to make international versions that will load ased on locality. And I dont know how to bundle it into the binary using some sort of resource management. ...

Python GTK Drag and Drop - Get URL

I'm creating a small app must be able to receive URLs. If the apps window is open, I should be able to drag a link from a browser and drop it into the app - and the app will save the URL to a database. I'm creating this in Python/GTk. But I am a bit confused about the drag and drop functionality in it. So, how do it? Some sample code t...

How to make two elements in gtk have the same size?

I'm using pyGTK. I want to layout a large element with 2 smaller ones on each side. For aesthetic reasons, I want the 2 smaller ones to be the same size. As it is, they differ by a few pixels, and the middle element is not centered as a result. I tried using gtk.Table with 3 cells, but having homogeneous=True doesn't have the desired ef...

In GTK, how do I get the actual size of a widget on screen?

First I looked at the get_size_request method. The docs there end with: To get the size a widget will actually use, call the size_request() instead of this method. I look at size_request(), and it ends with Also remember that the size request is not necessarily the size a widget will actually be allocated. So, is there any f...

In GTK, how do I make a window unable to be closed?

Example: graying out the "X" on windows systems. ...

GTK: Modify bg color of a CheckButton

I tried the following, yet the button still has a white background: self.button = gtk.CheckButton() self.button.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(65535,0,0)) self.button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(65535,0,0)) self.button.modify_fg(gtk.STATE_ACTIVE, gtk.gdk.Color(65535,0,0)) self.button.modify_b...

GTK: create a colored regular button

How do I do it? A lot of sites say I can just call .modify_bg() on the button, but that doesn't do anything. I'm able to add an EventBox to the button, and add a label to that, and then change its colors, but it looks horrendous - there is a ton of gray space between the edge of the button that doesn't change. I just want something that ...

In GTK on Windows, how do I change the background color of the whole app?

According to http://www.pygtk.org/docs/pygtk/gtk-constants.html, there are five state types: STATE_NORMAL, STATE_INSENSITIVE, etc. I want to set the background color of a Table, HBox, VBox, whatever, and I've tried setting every possible color of every kind of state: style = self.get_style() for a in (style.base, style.fg, style...