api comments

This commit is contained in:
Patrick 2025-10-08 18:36:54 +02:00
commit def04a9361

View file

@ -98,7 +98,8 @@ struct PGPL_GuiWidget {
double max_height);
/* This renders the content of the widget. Note that the margin, border,
* padding, background and offset of the widget must be accounted for BEFORE
* calling this function. For ease, you can use the
* calling this function. This includes any possible centering of the widget
* that may happen beforehand as well. For ease, you can use the
* pgpl_gui_widget_render_full function to automatically take care of all of
* those things for you. */
void (*render_content)(PGPL_GuiWidget *widget, PGPL_Renderer *renderer,
@ -106,7 +107,11 @@ struct PGPL_GuiWidget {
double max_width, double max_height);
/* This should get called for every event that is not a render or close event.
* Note that the x and y values should be called with the widgets offset
* pre-included. */
* pre-included, however the margin, padding and border should NOT be
* compensated for. This can be easily done inside of this method with the
* pgpl_gui_widget_adjust_event_params function, which adjusts the function
* parameters to match those that would have been passed to the render_content
* function. */
void (*event)(PGPL_GuiWidget *widget, PGPL_GuiTheme *theme, PGPL_Gui *gui,
PGPL_WindowEventType event_type,
PGPL_WindowEventData *event_data, double x, double y,