gtk

Is there any framework that allows me to develop applications for Qt and GTK?

I am thinking about something that would allow to develop applications independent of the GUI library, but allow Qt and GTK being plugged in as needed. ...

Simple "Hello-World" program for python-evince

I'm trying to write a simple "hello-world"-type program using the python-evince package for lucid-lynx gnome, that embeds Evince in a python-gtk window. The samples I've found on the web go like this: import evince import gtk w = gtk.Window() w.show() e = evince.View() w.add(e) e.show() document = evince.document_factory_get_document...

How to search through a gtk.ListStore in pyGTK and remove elements?

I have the following code (where store is a gtk.ListStore and titer is a gtk.TreeIter. The docs say that if there is no next row, iter_next() will return None, hence the break when that is found. It is supposed to search through the ListStore of (int, str) and remove the one item whose int component matches item_id. while True: ...

How to make tab text orientation of a notebook vertical (in gtkmm)

Hi, I want my notebook tab labels to be rotated by 90°. I tried the set_angle() function of Gtk::Label but it doesn't work: #include <gtkmm.h> int main(int argc, char *argv[]) { Gtk::Main kit(argc, argv); Gtk::Window mainwindow; Gtk::Notebook sidebar; Gtk::Label tab; mainwindow.add(sidebar); sidebar.set_tab...

Python window focus

I would like to find out if a window has focus. I am using pyGTK and would be helpful to us that but have got some Xlib in my script aswell. I've used: self.window.add_events( gdk.FOCUS_CHANGE_MASK ) # It took me ages to research this self.window.connect("focus-in-event", self.helloworld) but this gives me the event every time the win...

Installing Ruby-Gnome2 on Ubuntu with RVM

I have RVM running and it is working brilliantly, but I can't seem to figure out how to install ruby-gnome2. I have followed the steps on this tutorial, which are: rvm use 1.9.1 # I use 1.9.1 which should work with ruby-gnome2 wget http://downloads.sourceforge.net/ruby-gnome2/ruby-gnome2-all-0.19.4.tar.gz tar zxf ruby-gnome2-all-0.19.4....

How to create combobox with images in Gtk ?

Hi ! Can anyone please tell me how to create a combobox like following with Gtk (on Linux)? (I already ask this question for win32 API). A code example or tutorial will be very helpful. I have tried searching this over the internet, but unfortunately documentations/tutorials aren't that much rich for Gtk. Thank you very much. Rega...

QT or GTK for an embedded real-time display system based on Linux

We are trying to develop a real-time display system in safety critical domain. (All this is at very basic stage.) One option I have is to write my own Widgets using OpenGL. Other two options is to use something like GTK or QT. QT seems easy to use and has good development tools. But I have worked on several applications in real-time dom...

class extending GtkWindow

hi, i'm trying to learn c++, but i can not find if it's possible to extend a class in this way: main.cc #include "mWindow.h" using namespace std; int main( int argc, char* argv[] ) { gtk_init( &argc, &argv ); mWindow win = mWindow(); gtk_main(); return 0; } mWindow.cc #include "mWindow.h" mWindow::mWindow() { gtk...

Possible to avoid use of global variable in this situation?

I am writing a GTK+ application in C (though the principle here is widely applicable) which contains a GtkComboBox. The GtkComboBox is part of a larger structure returned by another function and packed into the main window. I don't see how I can get the value of what is selected in the GtkComboBox other than by setting a global variable...

emacs23 buffer menu font (GTK)

I've recently upgraded to emacs23 (Ubuntu 10.04) and I've managed to get my faces (fonts) all sorted out with relevant .emacs options. However the one font I can't seem to change is the one used to display the Buffer Menu (i.e. when you CTRL+left-click on a buffer, you get a pop-up menu that lists all open buffers). The problem is that...

Control tab focus (choose next element to focus) with GTK / PyGTK

How can I force the Tab to focus the element I want, is it possible to give my software a list of elements to cycle focus ? I remember once using a property called tabindex, but I can't find it anymore. Maybe, preventing Tab to focus an element could also work ? ...

Why expose event of my GTK+ widget will be freezed after a long time? Is it a GTK+ bug?

Hello... Here is my code: #include <gtk/gtk.h> static int counter = 0; static PangoLayout* layout; static GdkGC* gc1; static GdkGC* gc2; //**/static GMutex* mu; static gboolean on_expose_event(GtkWidget* widget, GdkEventExpose* event) { gchar the_string[20]; //**/g_mutex_lock(mu); gdk_draw_rectangle(GDK_DRAWABLE(widget->...

Compiling C++/GTK within Eclipse

I'm fiddling around with the C/C++ version of Eclipse to build a simple GTK app. However, I can't seem to be able to compile a GTK sample from within Eclipse. I think gtk is installed properly, used the ubuntu Package manager. the code is: #include <gtk-2.0/gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *window; g...

insert a bash like widget into gtk

Hi, When you write a program in c which has a lot of printf for a lot purpose: debuggin, information, etc. I would like to do something like that in gtk, having some widget that would display all the printf messages I usually would do in a normal c program Thanks, ---UPDATE--- I'm using vte as ptomato advised. Although some problems ...

GTK / PyGTK make ComboBox searchable with keyboard

Is it possible to make a ComboBox searchable ? If yes, how ? I want to be able, when the ComboBox is active and a letter is typed with the keyboard, to select the first item beginning with this letter inside the ComboBox and so on with the next letters. The is the same functionality of a ComboBox inside a webpage, for example. I can't...

How to have gtk control+c to be handled, or not?

I'm using pygtk, and would like to handle control+c sometimes to do a special copy action, but other times to let gtk handle it. For example, I'd like to put an object on my clipboard if it is available, or just let control+c be used in the normal fashion in a text entry. Currently I have an ActionGroup associated with "c" but that alwa...

Example code for a minimal paint program (MS Paint style)

I want to write a paint program in the style of MS Paint. On a most basic level, I have to draw a dot on the screen whenever the user drags the mouse. def onMouseMove(): if mouse.button.down: draw circle at (mouse.position.x, mouse.position.y) Unfortunately, I'm having trouble with my GUI framework (see previous question)...

What is the fastest way to plot a 2d numpy array of pixel data with pygtk?

I have a numpy array of pixel data that I want to draw at interactive speeds in pygtk. Is there some simple, fast way to get my data onto the screen? ...

GTK: Get co-ords of a mouse click in a window

In GTK I can't figure out what callback to setup so that when the user clicks in a window, I can get the X/Y co-ords of the click. ...