This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.
Window objects are the highest level containers within the user interface (Figure 1). They are composed of the title bar, where the close, maximize and minimize buttons are located, the interior area and the frame. If the window supports resizing, this frame can be dragged with the mouse to change its size. The interior area or client area of the window is configured by a Panel passed as a constructor parameter.
- Use window_create to create a window.
1. Window size
In principle, the window size is automatically calculated based on the Natural sizing of its main panel, but it can be changed at any time.
- Use window_size to change the size of the main panel.
- Use ekWNRES flag to create a user resizable window.
The change in the dimensions of the client area implies a re-location and resizing of the internal controls. This is automatically managed by Layout objects depending on how its Cell expansion, which will be recursively propagated by all sublayouts. In Die you have an example of resizing a window (Figure 2).
Create a new window.
Combination of window_flag_t values.
Main panel, which integrates the content of the window.
The window size will be calculated based on the Natural sizing of the main panel.
Destroy the window and all its contents.
void window_destroy(Window **window);
The window. Will be set to
Panels, layouts and components will be recursively destroyed.
Set an event handler for the window closing.
1 2 3 4 5 6 7 8 9 10 11
Callback function to be called before closing a window.
If for any reason the window should not close, it must be returned
FALSE as a result of the event. See GUI Events.
Set an event handler for moving the window on the desktop.
Callback function to be called as the title bar is dragged and the window moves across the desktop.
See GUI Events.
Set an event handler for window resizing.
Callback function to be called as the outer edges of the window are dragged to resize.
Set the text that will display the window in the title bar.
UTF8 C-string terminated in null character
Show the window. By default windows are created hidden. You have to show them explicitly.
void window_show(Window *window);
Hide the window.
void window_hide(Window *window);
Launch a window in modal mode.
The parent window.
Value returned by window_stop_modal.
parent stop receiving events until you call window_stop_modal.
Ends the modal cycle of a window.
The window previously launched with window_modal.
Value to be returned window_modal.
Recalculate the position and size of the controls after modifying any Layout.
void window_update(Window *window);
Move the window to specific desktop coordinates.
Set the size of the client area of the window.
Main panel size.
The final size will depend on the window frame and desktop theme settings. This measure only refers to the interior area.
Get the window position.
(x,y) from the upper-left corner of the window.
Get the total dimensions of the window.
The frame and title bar are taken into account.
Get the dimensions of the client area of the window.
Main panel size.
Set the default window button. It will be activated when pressed
Change the mouse cursor.
void window_cursor(Window *window, const cursor_t cursor, const Image *image, const real32_t hot_x, const real32_t hot_y);
Identifier of the new cursor.
Custom image. Only valid in ekCUSER.
The x coordinate of the click point. Only valid in ekCUSER.
The y coordinate of the click point. Only valid in ekCUSER.
hot_x, hot_y indicate the "sensitive" point within the image, which will indicate the exact position of the mouse.