How do I set the size of an EV_PIXMAP?
An EV_PIXMAP widget is a little different than other widgets in the sense that setting its minimum size will not change the size of the drawable canvas held within. In order to set the size of the pixmap, you have to call 'set_size'. This will resize the static image data to the required size, you can then call 'set_minimum_size' to the same as the image size then the pixmap will not shrink beyond the image data.
my_pixmap.set_size (200, 200)
-- Set the minimum size of the widget to match the image size.
my_pixmap.set_minimum_size (200, 200)
How do I have multi-line text in an EV_GRID?
An EV_GRID defaults to a fixed row height implementation for optimization purposes. To allow a multi-line label item you have to set the pixel height of the row in to which the label item is placed, like as follows.
l_grid.disable_row_height_fixed
create l_label_item.make_with_text ("Multi%NLined%NText")
l_grid.set_item (1, 1, l_label_item)
l_label_item.row.set_height (l_label_item.text_height)
How do I prevent my widget from losing focus when tabbing?
Each widget has a way of disabling the default key processing (ie: for tabbing, key events, dialog actions) via 'set_default_key_processing_handler'
With this routine you can pass a predicate agent (boolean function) that takes an EV_KEY as its first open argument, this will override all default key processing for that widget if the agent returns False.
create text_field
text_field.set_default_key_processing_agent (
agent (a_key: EV_KEY): BOOLEAN
do
-- If Tab key then return False
-- to prevent loss of focus when Tab key is pressed
Result := a_key.code /= {EV_KEY_CONSTANTS}.key_tab
end
)

