example-2.cc

来自「Developing with Gnome一书examples例子代码」· CC 代码 · 共 39 行

CC
39
字号
/* 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 + =
减小字号Ctrl + -
显示快捷键?