Skip to content

docs: Fix Warnings and Notes#925

Open
RobLoach wants to merge 2 commits intoImmediate-Mode-UI:masterfrom
RobLoach:doxygen-fix-warnings-notes
Open

docs: Fix Warnings and Notes#925
RobLoach wants to merge 2 commits intoImmediate-Mode-UI:masterfrom
RobLoach:doxygen-fix-warnings-notes

Conversation

@RobLoach
Copy link
Copy Markdown
Contributor

Fixes #917

@rswinkle
Copy link
Copy Markdown
Contributor

Looks good.

Comment on lines -1412 to 1411
* !!! \warning
* Only call this function between calls `nk_begin_xxx` and `nk_end`
* \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
* ```c
* struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
* ```
Copy link
Copy Markdown
Contributor

@sleeptightAnsiC sleeptightAnsiC Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Places, like this one, where the warning is immediately followed by the snippet, are not displaying correctly, because the snippet is being "swallowed" by the warning box. See:

Image

If you just add one newline right after the warning, it will fix the issue, like so:

Image

Copy link
Copy Markdown
Contributor

@sleeptightAnsiC sleeptightAnsiC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please fix all occurrences of the issue I just mentioned?

You can use the diff from below. I already tried it locally. Hopefully, I haven't missed anything else.

diff

diff --git a/nuklear.h b/nuklear.h
index 2b7aa57..92e9849 100644
--- a/nuklear.h
+++ b/nuklear.h
@@ -1622,6 +1622,7 @@ NK_API struct nk_window *nk_window_find(const struct nk_context *ctx, const char
  * \returns a rectangle with screen position and size of the currently processed window
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
  * ```
@@ -1640,6 +1641,7 @@ NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
  * \returns the position of the currently processed window.
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
  * ```
@@ -1658,6 +1660,7 @@ NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
  * \returns the size with width and height of the currently processed window.
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
  * ```
@@ -1676,6 +1679,7 @@ NK_API struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
  * \returns the width of the currently processed window.
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * float nk_window_get_width(const struct nk_context *ctx);
  * ```
@@ -1693,6 +1697,7 @@ NK_API float nk_window_get_width(const struct nk_context *ctx);
  * \returns the height of the currently processed window.
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * float nk_window_get_height(const struct nk_context *ctx);
  * ```
@@ -1712,6 +1717,7 @@ NK_API float nk_window_get_height(const struct nk_context* ctx);
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
  * \warning Do not keep the returned panel pointer around, it is only valid until `nk_end`
+ *
  * ```c
  * struct nk_panel* nk_window_get_panel(struct nk_context *ctx);
  * ```
@@ -1849,6 +1855,7 @@ NK_API void nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x
  * # # nk_window_has_focus
  * \returns if the currently processed window is currently active
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * nk_bool nk_window_has_focus(const struct nk_context *ctx);
  * ```
@@ -1866,6 +1873,7 @@ NK_API nk_bool nk_window_has_focus(const struct nk_context *ctx);
  * # # nk_window_is_hovered
  * Return if the current window is being hovered
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * nk_bool nk_window_is_hovered(struct nk_context *ctx);
  * ```
diff --git a/src/nuklear.h b/src/nuklear.h
index 2f431e6..9ec94d4 100644
--- a/src/nuklear.h
+++ b/src/nuklear.h
@@ -1406,6 +1406,7 @@ NK_API struct nk_window *nk_window_find(const struct nk_context *ctx, const char
  * \returns a rectangle with screen position and size of the currently processed window
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
  * ```
@@ -1424,6 +1425,7 @@ NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
  * \returns the position of the currently processed window.
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
  * ```
@@ -1442,6 +1444,7 @@ NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
  * \returns the size with width and height of the currently processed window.
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
  * ```
@@ -1460,6 +1463,7 @@ NK_API struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
  * \returns the width of the currently processed window.
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * float nk_window_get_width(const struct nk_context *ctx);
  * ```
@@ -1477,6 +1481,7 @@ NK_API float nk_window_get_width(const struct nk_context *ctx);
  * \returns the height of the currently processed window.
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * float nk_window_get_height(const struct nk_context *ctx);
  * ```
@@ -1496,6 +1501,7 @@ NK_API float nk_window_get_height(const struct nk_context* ctx);
  *
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
  * \warning Do not keep the returned panel pointer around, it is only valid until `nk_end`
+ *
  * ```c
  * struct nk_panel* nk_window_get_panel(struct nk_context *ctx);
  * ```
@@ -1633,6 +1639,7 @@ NK_API void nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x
  * # # nk_window_has_focus
  * \returns if the currently processed window is currently active
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * nk_bool nk_window_has_focus(const struct nk_context *ctx);
  * ```
@@ -1650,6 +1657,7 @@ NK_API nk_bool nk_window_has_focus(const struct nk_context *ctx);
  * # # nk_window_is_hovered
  * Return if the current window is being hovered
  * \warning Only call this function between calls `nk_begin_xxx` and `nk_end`
+ *
  * ```c
  * nk_bool nk_window_is_hovered(struct nk_context *ctx);
  * ```

Copy link
Copy Markdown
Contributor

@sleeptightAnsiC sleeptightAnsiC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warning messages broken in docs

3 participants