gtkmm

Drawing areas and expose events.

I have a dialogue which contains a drawing area. I wish to redraw the contents of the drawing area if the dialogue is enlarged or shrunk or buried and exposed, as is normal and natural with drawing areas. To this end, I created a method bool on_expose_event (GdkEventExpose *event); in the class. But the presence of this event stops a...

Drawing a temporary 'select' rectangle on a drawing area.

I have a complex drawing on a Gtk DrawingArea widget and I wish to provide the user with a way to select a rectangle on it to expand for a closer view. I have managed to get the necessary mouse button events sorted out so that the rectangle can be selected, but it would be desirable to have the actual rectangle drawn on the display, movi...

Retrieving the color of a given pixel in Gtk+/Gtkmm

Which is the best and fastest way to retrieve the color of a given pixel of a widget? For example: I load an image onto a Gtk::DrawingArea or draw something on it. Then I try to retrieve the color of the pixel that the mouse cursor is over. I use this technique: bool MainWindow::on_canvas_motion_notify(GdkEventMotion* event) { get_...

How to fill Gtk::TreeModelColumn with a large dataset without locking up the application

Hello, I need to fill in a large (maybe not so much - several thousands of entries) dataset to a Gtk::TreeModelColumn. How do I do that without locking up the application. Is it safe to put the processing into separate thread? What parts of the application do I have to protect with a lock then? Is it only the Gtk::TreemodelColumn class,...

How to set a Gtk Box to have two children

I have a Gtk::HBox which should contain two elements only. However, the constructor new Gtk::HBox() creates a box with three elements, so when I display my window, there is an ugly space where Gtk expects me to put a third element. I thought the Gtk api would provide an easy way to set the number of children, but it doesn't. Since Glade...