📄 example-2.cc
字号:
/* This program displays a "pulsing" (or whatever it's called) * ProgressBar, adds a timeout function to keep it updated, shows how * to make a derived widget in conjunction with libglade, demonstrates * overloading a function for a signal instead of connecting a * separate function to the signal, and show using a glibmm timer. * * Note that most programs update progress bars during some kind of * function that doesn't return to the main event loop (unlike this * simple example). In that case, you must manually tell gtk to * update widgets yourself by calling Gtk::MainContext::iteration. * (See example-3.cc for an example of doing this in a different * context). */#include <gtkmm.h>#include <libglademm/xml.h>#include "WasteTimeWindow.h"using namespace std;intmain (int argc, char *argv[]){ Glib::RefPtr<Gnome::Glade::Xml> what_a_waste; Gtk::Main kit(argc, argv); // load the interface what_a_waste = Gnome::Glade::Xml::create("example-2.glade"); // Get the main window WasteTimeWindow* window; what_a_waste->get_widget_derived("WasteTimeWindow", window); // start the event loop Gtk::Main::run( *window ); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -