中间类型

Some API related to gtkmm uses intermediate data containers, such as Glib::StringArrayHandle, instead of a specific Standard C++ container such as std::vector or std::list, though gtkmm itself now uses just std::vector since gtkmm 3.0.

You should not declare these types yourself. You should instead use whatever Standard C++ container you prefer. glibmm will do the conversion for you. Here are some of these intermediate types:

  • Glib::StringArrayHandleGlib::ArrayHandle<Glib::ustring>:使用 std::vector<Glib::ustring>std::list<Glib::ustring>const char*[] 等。
  • Glib::ListHandle<Gtk::Widget*>:使用 std::vector<Gtk::Widget*>std::list<Gtk::Widget*> 等。
  • Glib::SListHandle<Gtk::Widget*>:使用 std::vector<Gtk::Widget*>std::list<Gtk::Widget*> 等。