-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Old PR libui#512] Add new API functions to get and set the visibility of table headers. #23
Conversation
Added API functions: uiTableHeaderVisible() to determine whether the table header is visible. uiTableHeaderSetVisible() to set the visibility of the table header. Implementation provided for unix, darwin, and windows. Notes: as darwin does not provide an API for hiding or recreating the table header I opted for saving a reference and restoring that when the visibility is set back to true. Setting the header to nil to hide it is the suggested method for hiding the header according to the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windows
: LVM_GETHEADER
message appears to not set an error, so not much to do besides report "unknown error" back to the user from uiTableHeaderVisible()
. Also try to match the existing style of explicitly sending a WM message, instead of using the wrapper. The wrappers are less portable across different Windows toolchains.
Also wrapper macros here |
I did not know the macros were less portable. Any reference for that? Because the WM messages look hideous to me. So much clutter and risk of introducing bugs that I would personally love to avoid. |
You are not wrong, it is hideous. Regardless though, the more important point is that we should stay as consistent as possible with all the existing conventions. When we do adopt the macro wrappers over sending WM messages, it needs to be all or nothing across the entire |
That does indeed look old and seems to refers to mingw, which to my knowledge has always been very incomplete. I am pretty sure that's why only mingw-w64 is listed as supported in the first place.
Ok. I can change things to use SendMessageW. My idea was to use macros in new code while leaving SendMessageW in old code so we don't get too many merge conflicts. |
925e60f
to
47dbcab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Old PR libui#512
Proposal for two new API additions to un/hide table headers:
This was one of the requests in the table master issue.
--
Added API functions:
uiTableHeaderVisible() to determine whether the table header is visible.
uiTableHeaderSetVisible() to set the visibility of the table header.
Implementation provided for unix, darwin, and windows.
Notes: as darwin does not provide an API for hiding or recreating the
table header I opted for saving a reference and restoring that when the
visibility is set back to true. Setting the header to nil to hide it is
the suggested method for hiding the header according to the docs.