gtkmm

gtkmm statusicon quits after creation

南笙酒味 提交于 2019-12-11 10:58:19
问题 I have to create a simple application that displays an icon in the systray and a menu from which you can do some operations. the problem is that statusicon is closed immediately after creation. What's missing? I put the sleep to make sure it was created. for 3 seconds something appears in systray, even if it is not the icon that I set. Init.cc #include <gtkmm/main.h> #include "Tray.h" int main(int argc, char *argv[]) { Gtk::Main kit(argc, argv); printf("Statuicon starting\n"); Tray tray;

Linking gtkmm libraries in Visual Studio

 ̄綄美尐妖づ 提交于 2019-12-11 09:04:42
问题 So I had the same problem as this asker, and followed the advice of the accepted answer. I entered all the include directories given by pkg-config gtkmm-2.4 --cflags into my project, and finally it seemed to compile without a hitch. Then I tried pkg-config gtkmm-2.4 --libs , and got -LC:/gtk/lib -Lc:/devel/dist/win32/libpng-1.4.3-1/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0

Gtkmm 3.0 library for Windows

[亡魂溺海] 提交于 2019-12-11 07:09:18
问题 Can someone give me a link where i can download a gtkmm 3.0 library for development without need to build it by myself? thanks 回答1: http://live.gnome.org/gtkmm/MSWindows That is the best I could find. It stops at 2.8, tough. http://mail.gnome.org/archives/gtkmm-list/2011-April/msg00077.html That is an email to the gtkmm mailing list from the windows installer developer. It seems that the dev doesn't have much time for it right now (or at least didn't on April 28, 2011). Not much help, but

Read GTK Radio Button signal only when selected

懵懂的女人 提交于 2019-12-11 04:54:52
问题 GTK's "toggled" signal fires when a radio button is selected, but before that, it also fires upon deselection of the previously selected radio button. I am working with a GUI that uses radio buttons, each representing a group of entities. The first of the pair of "toggled" signals is triggering some unwanted updates to other fields in the GUI -- updates that I only want to happen when the newly selected button triggers the callback. How do I work around this signal and limit the callback

Gtkmm: Using RefPtr with widgets kept in std::vector

杀马特。学长 韩版系。学妹 提交于 2019-12-11 03:58:40
问题 I am trying to keep a std::vector of Gtk::Widget s that I am showing (and will potentially be) moving around between Gtk::Container s. At the moment I keep a Gtk::Notebook which is basically a one-to-one map to the std::vector , but if I use Glib::RefPtr around the widgets I get problems when removing the widget from the notebook. I already have to use a 'hack' to get a pointer to the underlying Gtk object when adding it to the notebook and I suspect that the Notebook container frees/deletes

How to grab and hide cursor using gtkmm?

南笙酒味 提交于 2019-12-11 02:22:16
问题 I'm trying to write an application using gtkmm, and I want it to hide the mouse cursor when it has focus. So the first step I tried is I hide mouse cursor when the cursor is on top of my window, which is successful. But to prevent the mouse from showing when it is moved outside of my window, I then restrict the mouse movement by constantly warp the mouse cursor back to the center of my drawing area. To do this I need to know the window position and the size of the window, which are easy to

How do you replace HBox/VBox with Box/Grid

这一生的挚爱 提交于 2019-12-10 11:49:19
问题 The documentation for HBox and VBox includes the statement: Deprecated: Use Box instead, which is a very quick and easy change. But we recommend switching to Grid, since Box will go away eventually. However, it isn't obvious what the "quick and easy change" should be. How do you use Box and/or Grid to achieve the functionality of VBox or HBox ? 回答1: One of the big changes in gtkmm3: Gtk::Box, Gtk::ButtonBox, Gtk::IconView, Gtk::Paned, Gtk::ProgressBar, Gtk::ScaleButton, Gtk::ScrollBar and Gtk

Gtkmm program compiles fine but crashes - windows XP

喜欢而已 提交于 2019-12-10 10:43:59
问题 I have recently installed gtkmm (gtkmm-2.4) when I compile with g++ I use the following information from pkg-config headerfiles pkg-config gtkmm-2.4 --cflags objectfiles pkg-config gtkmm-2.4 --libs So i compile I simple helloworld problam that is to show a window on the screen ... g++ gtkmm_app2.cpp -o gtkmm_app2 `pkg-config gtkmm-2.4 --cflags --libs` It compiles fine but when I execute the program it chrashes. I get the following information: An unhandled win32 exception occurred in gtkmm

Gtkmm - “Gtk::DrawingArea” in “Gtk::ScrolledWindow”?

雨燕双飞 提交于 2019-12-10 10:16:23
问题 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, 0)" to let's say "(100, 70)" pixel - the drawing area should be resized to a rectangle of size "(100, 70)". And to do this - I put the "Gtk::DrawingArea" widget into

Get pixel value on Gdk::Pixbuf, Set pixel value with Gdk::Cairo

对着背影说爱祢 提交于 2019-12-10 09:26:33
问题 I'm using a Gdk::Pixbuf to display an image with Gdk::Cairo in C++ : virtual bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { Glib::RefPtr<Gdk::Pixbuf> image = Gdk::Pixbuf::create_from_file(filename); Gdk::Cairo::set_source_pixbuf(cr, image, (width - image->get_width())/2, (height - image->get_height())/2); cr->paint(); /* other displaying stuffs */ } This image is in B&W and I need to bring out some pixels whose luminance is above a certain threshold. For that, I would like to color