gtkmm

Gtk::Button with standard Icons

余生长醉 提交于 2021-02-10 07:28:12
问题 if I use: Gtk::Button* button = Gtk::manage( new Gtk::Button(Gtk::Stock::DELETE)); it works perfect, but the documentation and the header says: Deprecated, use label _Delete But if I simply write Gtk::Button* button = Gtk::manage( new Gtk::Button("_Delete")); the button shows simply the text _Delete . How can I create a standard button in the "new" fashion? Update: There is simply no plan to make anything automated anymore in gtk. There was a long discussion on the developers mailing list.

CMake error with gtkmm

不打扰是莪最后的温柔 提交于 2021-02-07 20:32:29
问题 I'm using Debian 8 and have installed libgtkmm-3.0 (and also -dev). Now I have a very simple program using gtkmm, basically a Hello World: main.cpp: #include "../include/BrowserWindow.class.hpp" #include <gtkmm/application.h> int main(int argv, char *argc[]) { Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example"); BrowserWindow helloworld; //Shows the window and returns when it is closed. return app->run(helloworld); } BrowserWindow.class.cpp: #include

CMake error with gtkmm

白昼怎懂夜的黑 提交于 2021-02-07 20:30:01
问题 I'm using Debian 8 and have installed libgtkmm-3.0 (and also -dev). Now I have a very simple program using gtkmm, basically a Hello World: main.cpp: #include "../include/BrowserWindow.class.hpp" #include <gtkmm/application.h> int main(int argv, char *argc[]) { Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example"); BrowserWindow helloworld; //Shows the window and returns when it is closed. return app->run(helloworld); } BrowserWindow.class.cpp: #include

gtkmm drawing single pixels

[亡魂溺海] 提交于 2021-02-07 08:36:59
问题 Refering to the example on the Documentation for Gtkmms GdkRGB: #include <gtk/gtk.h> #define IMAGE_WIDTH 256 #define IMAGE_HEIGHT 256 guchar rgbbuf[IMAGE_WIDTH * IMAGE_HEIGHT * 3]; gboolean on_darea_expose (GtkWidget *widget, GdkEventExpose *event, gpointer user_data); int main (int argc, char *argv[]) { GtkWidget *window, *darea; gint x, y; guchar *pos; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); darea = gtk_drawing_area_new (); gtk_widget_set_size_request (darea,

gtkmm/c++ first hello world example leaking memory

一世执手 提交于 2021-02-07 06:26:10
问题 I'm trying to learn gtkmm, and decided to try gtkmm 2.4 for the time being since it seems to be pretty hard to get 3.0 working on Debian. Anyway, the example I'm trying is the one here: http://developer.gnome.org/gtkmm-tutorial/2.24/sec-helloworld.html.en. It compiles fine and it runs alright aswell, but when i close it valgrind reports a lot of leaks, something along the lines of this (after clicking the button once): ==4254== Memcheck, a memory error detector ==4254== Copyright (C) 2002

gtkmm/c++ first hello world example leaking memory

走远了吗. 提交于 2021-02-07 06:25:09
问题 I'm trying to learn gtkmm, and decided to try gtkmm 2.4 for the time being since it seems to be pretty hard to get 3.0 working on Debian. Anyway, the example I'm trying is the one here: http://developer.gnome.org/gtkmm-tutorial/2.24/sec-helloworld.html.en. It compiles fine and it runs alright aswell, but when i close it valgrind reports a lot of leaks, something along the lines of this (after clicking the button once): ==4254== Memcheck, a memory error detector ==4254== Copyright (C) 2002

How to disable buttons in GTK3

筅森魡賤 提交于 2021-02-04 17:23:27
问题 Windows API has a function called EnableWindow that disables controls so user can't interact with them any more. Is there an equivalent for GTK3 or GTK3++? 回答1: gtk_widget_set_sensitive (widget, FALSE); Note that if you need to check whether a widget is sensitive, gtk_widget_get_sensitive() returns the value set with the above function and gtk_widget_is_sensitive() will tell you whether the widget really is sensitive -- this is affected by parent widgets sensitivity as well. 回答2: For specific

Force numeric input in a Gtk::Entry widget

回眸只為那壹抹淺笑 提交于 2021-01-27 11:33:10
问题 I'm searching for a possible method to only allow numeric input in a Gtk::Entry widget, without relying on SpinButtons. The matter is, I found a template for this (link), but it just won't work. I can compile it along my other code, but if I want to declare an instance with NumericEntry<int> int_entry(1,0,10); it tells me expected ‘,’ or ‘...’ before numeric constant The second part is, that I have no clear idea how to pack this entry, because I get a can't convert to widget error when using

Force numeric input in a Gtk::Entry widget

岁酱吖の 提交于 2021-01-27 11:29:11
问题 I'm searching for a possible method to only allow numeric input in a Gtk::Entry widget, without relying on SpinButtons. The matter is, I found a template for this (link), but it just won't work. I can compile it along my other code, but if I want to declare an instance with NumericEntry<int> int_entry(1,0,10); it tells me expected ‘,’ or ‘...’ before numeric constant The second part is, that I have no clear idea how to pack this entry, because I get a can't convert to widget error when using