Changes in ocempgui.widgets

Widgets are not placed using absolute coordinates anymore. Instead they are placed relative to their parent coordinates, which applies especially to boxed widgets being put in Bins or Containers. Their position attributes such as top, topleft, rect, ... thus refer to their relative position. To retrieve the absolute coordinates, you should use their rect_to_client() method.

The position attribute and set_position method of widgets are deprecated and will be removed completely in a later version. The new topleft attribute will replace them. Make sure to change your code accordingly over time.

The size attribute of widgets is no longer writeable and its function was replaced by the new minsize attribute. The set_size() method however is still available but deprecated. Make sure, that your code respects that change.

The eventarea attribute and set_event_area() method of widgets are deprecated, do not have any functionality anymore and will be removed completely in a later version. The new method rect_to_client() provides a read-only replacement for them in a slightly different intention.

The drawing code and behaviour heavily changed in 0.2.x, so that the widget method draw_bg() now will take care of drawing a widget background (usually invoking Style.engine.draw_WIDGET()), while draw() will do the rest. This should only affect user-defined widgets or inheritors, which override the default drawing code. For more details see the section called “Changing the widget appearance”.

Most Button widget implementations now inherit from the newly added ButtonBase class. This should not harm the most code, but inheritance checks might have to change accordingly. Make sure to recheck your code.

The ScrolledWindow class now encapsulates widgets using the ViewPort class. Code that relies upon the child attribute of it, should be changed accordingly.

The get_visible_area() method of the ScrolledWindow class is no longer publicly available.

The get_scrollable_area() if the ScrolledWindow class was removed without a replacement.

The get_coords_from_value() and get_value_from_coords() methods of the Scale and ScrollBar classes are no longer publicly available.

The get_slider_size() and get_button_coords() methods of the ScrollBar classes are no longer publicly available.

The RenderLayer class was removed without a replacement.

The Renderer class does not directly inherit from the EventManager and RenderLayer classes anymore. A replacement for the EventManager functionality is the new managers attribute. Code, that added user-defined objects to the Renderer should use the attribute and its layered behaviour from now on.

The force_update() method of the Renderer class was removed. User code should use the update() and/or refresh() methods now.

The colour for flat borders (BORDER_FLAT) is no longer retrieved using the 'fgcolor' entry, but instead uses the new 'bordercolor' style entry. Code, that made use of this should be changed to use 'bordercolor' from now on.

The Style no longer directly defines drawing routines. Instead it uses the drawing engine bound to its engine attribute. User code, that made use of this, has to be changed accordingly. See the section called “Changing the widget appearance” for more details.