gtkmm

Signal fires twice from gtkmm popup list

It's been a while since I used GTK+, and the last time I did was in C, not using gtkmm and C++ as I am now. Anyway, I have what I think should be an easy problem to solve: I have a popup menu consisting of a list of radio buttons, and when I click one of them I want some action to occur. The code goes like this: Gtk::RadioMenuIte...

Packaging an application with dependencies under Windows

I've written an application using gtkmm and libpcap under Linux. Of course, gtkmm depends on GTK+. After porting it to Windows and attempting to distribute it, the feedback I received is that there are too many dependencies to install. The user has to run installers for the GTK+, gtkmm, and winpcap runtimes before they can run my littl...

Should I learn GTK+ or GTKMM?

I am a C# programmer who started using ubuntu about 2 years ago. I'm wanting to learn GUI programming in either C or C++. I don't really like mono, it tends to crash on my system. I have a basic understanding of C++. I have never worked in C, but it looks cool. Which toolkit should I learn/use? Give Pro/Cons of each. Thanks! ...

gtkmm: update gui from other thread?

I am using gtkmm (and glibmm), and I would like to update the GUI from another thread. I have followed the example on http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/thread_2dispatcher_8cc-example.html#_a1 but I have 2 questions: Instead of a Glib::MainLoop receiving the events, is it possible for a Gtk::Main (that runs my...

Gtkmm Tutorial?

Where can I find a Gtkmm tutorial? I'm primarily a C# programmer, but I also know C++. ...

How to get the height of the gtktreeview header?

I've looked in the gtk source code and the header height is private. I've tried something but it didn't work as wanted (the heightWithHeader is 1?!) Glib::RefPtr<Gdk::Window> pWindow = treeView.get_bin_window(); treeView.set_headers_visible(true); pWindow->get_size(width, heightWithHeader); treeView.set_headers_visible(false); pWindo...

How to remove the GtkTreeView sorting arrow?

I need to remove the sorting arrow from a column header. This can be done by calling set_sort_indicator(false) on the column. The arrow isn't displayed, but the space for it seems to still be reserved. If the title of the column is big enough to fill all the header, the last part is clipped (where the arrow should be). Is there a way ...

If I have two instances of Glib::IOChannel, they block until both written. What is the correct way to do this?

I have modified the example found here to use two io channels. None of the callbacks seem to be called before I have written to both channels. After that they are called individually when writing to the fifos. Am I forgetting something? Start the test program in one shell window. Write echo "abc" > testfifo1 in second shell window. -> ...

Why won't Gtk's button_press_event receive single left clicks?

I am trying to set up an add-tab button in a Gtk::Notebook (gtkmm). I am doing this by drawing a pixmap to a calculated position -- that works just fine. However, when trying to receive events for it, I cannot pick up a single left click. Single middle and single right give both press and release events, and double left gives just a pres...

Stacking widgets in Gtk+

Is there a way in Gtk+ to stack one widget on top of another -- not counting GtkFixed? GtkFixed doesn't work well for two reasons: 1) I need Z order, and 2) I need one widget to stretch and fill provided space. ...

Gtk+ mouse pointer leave-area event

I need to detect when the mouse pointer leaves an area in a GtkNotebook. Normally this is possible with the motion_notify event, but if the pointer is moved fast enough, the event is not triggered. Because this is a certain area of pixels in a GtkNotebook, it is not possible to use a GtkEventBox. What is the proper way to do this? ...

glibmm timeout signal

I'm working on a plugin for a smaller application using gtkmm. The plugin I'm working on checks certain conditions (the date had changed and a new day started) after every minute and starts some actions if the conditions are true. In the initialization part of the plugin I have the following piece of code that uses Glib::SignalTimeout an...

How to update Gtk::TreeModel::Row from external function

Currently I'm developing a multi-thread application. I use a TreeView to display the states of each thread, one row per thread. There are mainly two classes: Main GUI class containing TreeView class for thread handling Passing Gtk::TreeModel::iterator as an argument to the second class is not viable since we cannot access the element...

Segfault when calling Gtkmm textBuffer->insert

I'm just learning about gtkmm for c++. I'm having trouble getting a simple TextBuffer to add a new line of text. I have a class called OutputBox which is an HBox with a TextViewer (called messages) and a TextBuffer (called textBuffer) in it. Here is a small chunck of the OutputBox class: OutputBox::OutputBox() { textBuffer = messages...

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...

fink doesn't list gtkmm2.4

I'm trying to get started with gtkmm, and I'm using a mac. So I tried using fink to get it installed. Looking online, it seems to be up to date, but when I check on the command line fink list gtkmm It only lists gtkmm2. I went ahead and tried that, but it really is the gtkmm 2.0 distribution. I'd really like to be up to date on this, ...

Gtkmm - "Gtk::DrawingArea" in "Gtk::ScrolledWindow"?

Hello, I am making a GUI program using "gtkmm". I would like to draw some graphics to the "Gtk::DrawingArea" widget but I want that widget to be "resizable", so when I draw let's say a line from "(0, 0)" to "(50, 50)" pixel - the drawing area should be resized to a square of size "(50, 50)"; and when I for example draw a line from "(0...

How to draw a tree using Gtkmm?

I want to draw a tree, to visualize this abstract data structure. Are there any existing libraries for me to do this? I don't want to manually write Cairo code... ...

show image in gtkmm from integer array

I have an integer array with a gray scale image and I need to show it in my application. I'm programing in C++ with gtkmm and I can't find any widget like a canvas that allow you to show and access each pixel in the image. ...

OpenGL + gtkglextmm + glade

Hello, when I am programming with "gtkmm", there is a widget "Gtk::DrawingArea". I can program that widget "by hand" (so write the code) or more elegant way is to use "glade" user interface designer, where I can do the same "graphically". Now I am trying to connect OpenGL with gtkmm through "gtkglextmm" library. In that library, there i...