rodrigocfd / windigo

Windows API and GUI in idiomatic Go.
https://pkg.go.dev/github.com/rodrigocfd/windigo
MIT License
405 stars 22 forks source link

Up-Down Control #28

Open chabad360 opened 8 months ago

chabad360 commented 8 months ago

https://learn.microsoft.com/en-us/windows/win32/controls/up-down-control-reference

I'm currently trying to implement it my self, it's a little annoying cause I can't repurpose the _NativeControlBase (the createWindow function is private... Actually, for that matter, it seems your API is rather hostile to user components).

chabad360 commented 8 months ago

So, I managed to figure it out. However, it's a little problematic, see here for the implementation. It needs to be created after the item that it's attached to (in order to display correctly), but because I can only run it on the public WmCreate, it gets created after all the other elements, resulting in the last one (a button in this case) getting attached, which changes its text to 0 and its size becomes smaller to fit, which is rather annoying to fix.