API Changes

Here, you can find the API changes from the version 1.0. In addition, some hints are provided to help you update your code.



The changes about ComboBox are about providing a common interface with ListBox.

  • Rename remove() to remove_item().
  • Uses StringItem as item type instead of string.
    - combo->add_item("Item1");
    + combo->add_item(std::make_shared<egt::StringItem>("Item1"))
    auto s = combo->item_at(i);
    - if (s == "ok")
    + if (s->text() == "ok")
  • Add show() and hide() member functions.


  • Restrict items to StringItem instead of Widgets.


  • Add n_col() and n_row() member functions to get the number of columns and rows.
  • Add add() member functions taking a GridPoint as parameter instead of column and row. Prefer these new member functions to the older ones.
    - grid.add(button, 2, 1);
    + grid.add(button, egt::StaticGrid::GridPoint(2, 1));
  • Layout changes: the border of the widget is no longer used to space out cells. Remove the border parameter from the constructor and add horizontal/vertical_space getters and setters.
    - auto grid = make_shared<StaticGrid>(StaticGrid::GridSize(2, 2), 1);
    + auto grid = make_shared<StaticGrid>(StaticGrid::GridSize(2, 2));
    + instance->horizontal_space(1);
    + instance->vertical_space(1);


  • Add auto_scale_image() setter and getter. The auto scale image state is set to true by default. When enabled, the image will be automatically scaled down to fit the box attributed by the align algorithm.