Thanks, I'll take a look but I'm not very fast on PB at the moment, I'm trying to adapt to the speed of the forum
Object Theme Library (for Dark or Light Theme)
Re: Object Theme Library (for Dark or Light Theme)
Hello jacdelad,
Thanks, I'll take a look but I'm not very fast on PB at the moment, I'm trying to adapt to the speed of the forum
Thanks, I'll take a look but I'm not very fast on PB at the moment, I'm trying to adapt to the speed of the forum
Re: Object Theme Library (for Dark or Light Theme)
Right now it's fast. Hurry up!
But for real, I'll do some more testing. I saw that ImageButtons seem not to work (I guess you simulate buttons?) and one of my SpinGadgets, but I firstly need to find out why.
But for real, I'll do some more testing. I saw that ImageButtons seem not to work (I guess you simulate buttons?) and one of my SpinGadgets, but I firstly need to find out why.
Good morning, that's a nice tnetennba!
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
Re: Object Theme Library (for Dark or Light Theme)
Hello jacdelad,
I'm late, it's worse than with AI chabots.
I added SetObjectTheme(#PB_Default) = FreeObjectTheme()
It partially reverts to the default values for gadgets, without the Callback, FreeMemory(), and DeleteMapElement(),
but it is not a complete return to a pure PB interface, not everything has been cleaned up, restore the default themes
ObjectTheme v1.6.4
Otherwise, indeed, ImageButtons are managed in the same way as Buttons. for colors, borders. There is just DrawAlphaImage() in addition.
And for the SpinGadget, it seems to be working as intended here. With its EditBox background color accentuated, as for strings or editors.
You can change it if you want by modifying this line:
I'm late, it's worse than with AI chabots.
I added SetObjectTheme(#PB_Default) = FreeObjectTheme()
It partially reverts to the default values for gadgets, without the Callback, FreeMemory(), and DeleteMapElement(),
but it is not a complete return to a pure PB interface, not everything has been cleaned up, restore the default themes
ObjectTheme v1.6.4
Otherwise, indeed, ImageButtons are managed in the same way as Buttons. for colors, borders. There is just DrawAlphaImage() in addition.
And for the SpinGadget, it seems to be working as intended here. With its EditBox background color accentuated, as for strings or editors.
You can change it if you want by modifying this line:
Code: Select all
If IsDarkColor(\lBackColor) : \lBackColor = AccentColor(\lBackColor, 15) : Else : \lBackColor = AccentColor(\lBackColor, -15) : EndIf
Last edited by ChrisR on Thu Mar 12, 2026 12:48 am, edited 1 time in total.
Re: Object Theme Library (for Dark or Light Theme)
Thanks ChrisR! I'll try this out.
In the meantime I found some more...things: A deactivated ComboBoxGadget is painted in standard colors. Also, disabled SpinEdit too. Even if the SpinEdit is reactivated it isn't painted correctly. But I'm not sure sure, whether it's my fault or not.
Edit: Ignore the SpinEdit, there's a problem on my side. I'll fix this first before complaining again.
In the meantime I found some more...things: A deactivated ComboBoxGadget is painted in standard colors. Also, disabled SpinEdit too. Even if the SpinEdit is reactivated it isn't painted correctly. But I'm not sure sure, whether it's my fault or not.
Edit: Ignore the SpinEdit, there's a problem on my side. I'll fix this first before complaining again.
Good morning, that's a nice tnetennba!
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
- Michael Vogel
- Addict

- Posts: 2867
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Object Theme Library (for Dark or Light Theme)
Yes, comboboxes are a nightmare - see also here...
I'd pay for additional gadget types being supported by Purebasic's internal commands.
I'd pay for additional gadget types being supported by Purebasic's internal commands.
Re: Object Theme Library (for Dark or Light Theme)
And I don't even use images.
I guess with every additional program using the library it gets better until finally everything will (this will be the day when Microsoft decides to change something, so nothing wil work anymore).
@ChrisR: Another thing I found is that when I open a new window, it has to be skinned. Reapplying the theme leads to massive flickering. Is there a command to just apply it to a specific window (and gadgets on it)? Also, I tried wm_setredraw to stop the flickering, but it doesn't work well.
Sorry for giving you work...
I guess with every additional program using the library it gets better until finally everything will (this will be the day when Microsoft decides to change something, so nothing wil work anymore).
@ChrisR: Another thing I found is that when I open a new window, it has to be skinned. Reapplying the theme leads to massive flickering. Is there a command to just apply it to a specific window (and gadgets on it)? Also, I tried wm_setredraw to stop the flickering, but it doesn't work well.
Sorry for giving you work...
Good morning, that's a nice tnetennba!
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
Re: Object Theme Library (for Dark or Light Theme)
No, there is no command to just apply it to a specific window and its gadgets.
It is intended to be applied to all windows and gadgets to achieve the same design and harmony across the entire app.
However, not ideal but if you really need not to apply the theme to a specific window, you can call the _PB(Function) macro, ex:
As for the flickering, that's unfortunately how it is with Windows, I don't think ObjectTheme is really related to it.
Good luck reducing the flickering:
It is intended to be applied to all windows and gadgets to achieve the same design and harmony across the entire app.
However, not ideal but if you really need not to apply the theme to a specific window, you can call the _PB(Function) macro, ex:
Code: Select all
_PB(OpenWindow)(#WindowX, X, Y, Width, Height, "Title", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
_PB(ButtonGadget)(#ButtonX, 40, 40, 200, 60, "Button")As for the flickering, that's unfortunately how it is with Windows, I don't think ObjectTheme is really related to it.
Good luck reducing the flickering:
Code: Select all
SetWindowLongPtr_(GadgetID, #GWL_STYLE, GetWindowLongPtr_(GadgetID, #GWL_STYLE) | #WS_CLIPCHILDREN) ; For Container
SendMessage_(GadegtID, #WM_SETREDRAW, #False(#True), 0)
RedrawWindow_(GadgetID, #Null, #Null, #RDW_INVALIDATE | #RDW_ERASE | #RDW_ALLCHILDREN | #RDW_UPDATENOW)
UpdateWindow_(GadgetID)
...Re: Object Theme Library (for Dark or Light Theme)
Ok, so I experimented a bit more. Trying the monowindows-stuff next.
What I found out:
- SetObjectTheme(#PB_Default) works very well. Just the window background is white, not reset to the default color. Is this normal? My fault?
- Also I have one SpinEdit within a frame which does not work when being reenabled. Since the disabled SpinEdits are always misdrawn, I'll replace it with a ComboBox.
It's a shame that skinning is so much work...
What I found out:
- SetObjectTheme(#PB_Default) works very well. Just the window background is white, not reset to the default color. Is this normal? My fault?
- Also I have one SpinEdit within a frame which does not work when being reenabled. Since the disabled SpinEdits are always misdrawn, I'll replace it with a ComboBox.
It's a shame that skinning is so much work...
Good morning, that's a nice tnetennba!
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
Re: Object Theme Library (for Dark or Light Theme)
Not your Fault, that's what I do. If I delete the theme, I reset the color to GetSysColor_(#COLOR_WINDOW)jacdelad wrote: Tue Mar 10, 2026 9:22 pm SetObjectTheme(#PB_Default) works very well. Just the window background is white, not reset to the default color. Is this normal? My fault?
If you want something else, you can change it by changing the line
Code: Select all
_PB(SetWindowColor)(\PBGadget, GetSysColor_(#COLOR_WINDOW)) ;_PB(SetWindowColor)(\PBGadget, #PB_Default)#
Yes, I reproduce it if DisableGadget(#Spin, #True) is done before SetObjectTheme(#ObjectTheme_xxx)jacdelad wrote: Tue Mar 10, 2026 9:22 pm Also I have one SpinEdit within a frame which does not work when being reenabled. Since the disabled SpinEdits are always misdrawn, I'll replace it with a ComboBox.
But it seems to work if disable is done after
I need to look into it, it's a bug, but I don't have time right now.
Code: Select all
XIncludeFile "ObjectTheme.pbi"
UseModule ObjectTheme
Macro DisableSpin(_State)
DisableGadget(2, _State)
DisableGadget(3, _State)
DisableGadget(4, _State)
EndMacro
If OpenWindow(0, 0, 0, 320, 170, "Title", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
CheckBoxGadget(0, 20, 20, 280, 22, "Disable SpinGadget")
SetGadgetState(0, #True)
FrameGadget(1, 140, 60, 160, 90, "Frame_1")
SpinGadget(2, 20, 70, 100, 24, 0, 100, #PB_Spin_Numeric)
SetGadgetState(2, 22)
SpinGadget(3, 170, 100, 100, 24, 0, 100, #PB_Spin_Numeric)
SetGadgetState(3, 44)
SpinGadget(4, 20, 110, 100, 24, 0, 100, #PB_Spin_Numeric)
CompilerIf #PB_Compiler_OS = #PB_OS_Windows : SetWindowLongPtr_(GadgetID(4), #GWL_STYLE, GetWindowLongPtr_(GadgetID(4), #GWL_STYLE) | #ES_NUMBER) : CompilerEndIf
SetGadgetState(4, 66)
;DisableSpin(#True) ; Does NOT work if done before SetObjectTheme()
SetObjectTheme(#ObjectTheme_DarkBlue)
DisableSpin(#True)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadget()
Case 0
DisableSpin(GetGadgetState(EventGadget()))
EndSelect
EndSelect
ForEver
EndIfYeah, sure, there are a lot of constants to fill in, even though for the most part it works using #PB_Default only
But it would be nice to have a tool window that can be called up to edit a theme with the properties of each gadget editable to see the result in real time.
Re: Object Theme Library (for Dark or Light Theme)
I updated to fix the display bug on the SpinGadget, if it is disabled before using SetObjectTheme(#ObjectTheme_xxx)
ObjectTheme v1.6.5
ObjectTheme v1.6.5
Re: Object Theme Library (for Dark or Light Theme)
Thanks Chris, I'll try this.
Good morning, that's a nice tnetennba!
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
Re: Object Theme Library (for Dark or Light Theme)
I tested it, great!
About the window thing: I think #PB_Default is better since this is the color every open window starts. Or you could put a note into the introduction.
About the SpinEdit: Would it be possible to check whether the SpinEdit is enabled while apllying the theme. Maybe you can enable it, apply the Theme, disable it. The window is flickering anyway.
Another thing: When reverting to the normal theme, the titlebar isn't reset. Is this on purpose?
Sorry for keeping you busy.
About the window thing: I think #PB_Default is better since this is the color every open window starts. Or you could put a note into the introduction.
About the SpinEdit: Would it be possible to check whether the SpinEdit is enabled while apllying the theme. Maybe you can enable it, apply the Theme, disable it. The window is flickering anyway.
Another thing: When reverting to the normal theme, the titlebar isn't reset. Is this on purpose?
Sorry for keeping you busy.
Good morning, that's a nice tnetennba!
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500