[gnomemm] gnomemm PORTING guide



Hi all,

I have rearranged the info to be more readable and fixed some things. Grammar and typo corrections are welcome.

This should help people with some of the first problems that they are likely
to find when porting apps from gnomemm 1.2 to gnomemm 2:

This guide is an addition to the gtkmm porting guide, you should first read:
http://cvs.gnome.org/lxr/source/gtkmm-root/base/PORTING

* Replace gnome-- 1.2 includes with gnomemm2 includes:
  e.g. #include <libgnomeuimm/app.h> instead of <gnome--/app.h>
  e.g. #include <libgnomeuimm.h> instead of <gnome--.h>

* New parameter to create a gnome application:
e.g. use Gnome::Main application(appname, version, Gnome::UI::module_info_get(), argc, argv);
  instead of Gnome::Main application(appname, version, argc, argv);

* Classes moved to the Gnome::UI namespace:
* Change Gnome::App to Gnome::UI::App
* Change Gnome::AppBar to Gnome::UI::AppBar
* Change Gnome::About to Gnome::UI::About and add the missing arguments

* Classes moved to gtkmm:
* Change Gnome::Pixmap to Gtk::Image
* Change Gnome::Dialogs::error(parent, message) to Gtk::MessageDialog(parent, message, Gtk::MESSAGE_ERROR);
* Change Gnome::StockPixmap(GNOME_STOCK_PIXMAP_SAVE) to
  Gtk::Image(Gtk::StockID(Gtk::Stock::SAVE), Gtk::ICON_SIZE_SMALL_TOOLBAR)

* The Stock definitions have been moved to gtkmm:
* Change GNOME_STOCK_MENU_NEW to Gtk::Stock::NEW
* Change GNOME_STOCK_MENU_PROP to Gtk::Stock::PROPERTIES

* Menu building classes which changed namespace:
* Change Gnome::MenuItems to Gnome::UI::MenuItems
* Change Gnome::UI::Info to Gnome::UI::Items::Info
* Change Gnome::UI::Separator() to Gnome::UI::Items::Separator()
* Change Gnome::UI::Array to Gnome::UI::Items::Array
* Change Gnome::UI::SubTree to Gnome::UI::Items::SubTree
* Change Gnome::UI to Gnome::UI::MenuItems or Gnome::UI::Items
* Note: the Menuitems namespace is for standard menuitems (New, Open, ...) and the Items namespace for custom menuitems.
* Change Gnome::Menus to Gnome::UI::Menus
* Change Gnome::UI::Menu to Gnome::UI::Items::Menu
* Note: the Menus namespace is for standard menus (File, Edit, ...) and the Menu class is for custom menus.

* Timeouts are not tied to Gnome::Main:
e.g. use Glib::signal_timeout().connect(SigC::slot(&guiUpdatePeriodic), 2000); instead of application.timeout.connect(SigC::slot(&guiUpdatePeriodic), 2000);


--
Manuel Clos
llanero eresmas net

TCPA y Palladium: http://bulmalug.net/body.phtml?nIdNoticia=1398
TCPA and Palladium: http://www.cl.cam.ac.uk/~rja14/tcpa-faq.html




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]