|
|
I found the test/icon demo a bit confusing.
I've never actually used it and couldn't really tell what it did, even from the code comments; Is this for testing widget icons or the window manager icon? When it opens it just says "Colour" and the choice is "red" but nothing is red, and what's it the color of? It's only when you change the choice to something else it properly updates the icon, which is weird. And shouldn't there be a way to set 'no icon'?
Here's a few improvements that come to mind:
- Change the choice label from just "Colour" to "Window icon:"
- Have "none" as the default/initial choice, and tweak the callback to allow for the 'none' choice to invoke
win->icon(0); , which according to the docs is a valid way to 'reset' the icon.. a good thing to test to make sure an icon can be assigned, then unassigned.
- The class instance
Fl_RGB_Image icon goes out of scope on returning from the callback. It is not clear in the docs for Fl_Window::icon(Fl_RGB_Image)that the buffer is no longer needed, so not sure if this is a bug or correct behavior. (a) Docs for icon() should be improved me thinks, to indicate if the buffer needs to remain allocated or not, and if it is OK, (b) adding a comment on the win->icon(&icon);line that says something like // once assigned, 'icon' can go out of scope` just to make it clear.
- Perhaps a tooltip for the choice that elaborates on what this program does; affects the window manager's title bar and toolbar icon.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
[ Direct Link to Message ] | |
|
| |