GTK3 SetGadgetColor Workaround (Teamwork / Release)

Linux specific forum
User avatar
mk-soft
Always Here
Always Here
Posts: 6205
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by mk-soft »

Update v1.02
- Fixed some colors
- Added SetWindowColor

Thanks to Shardik. I hope I got to insert it :wink:

Link: https://www.purebasic.fr/german/viewtop ... or#p347885
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 6205
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by mk-soft »

Update v1.03
- Bugfix memory leak

gtk_container_get_children_(...) returns a newly-allocated list
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 6205
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by mk-soft »

Update v1.04
- Bugfix CSSColorString
- Update Macro SetProvider to Procedure GtkSetProvider(...)
- Update Macro SetOverride to Procedure GtkSetOverride(...)
- Update Example
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
dibor
Enthusiast
Enthusiast
Posts: 160
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by dibor »

Excellent workaround but doesn't works on Raspberry Pi :(
Impossible to change window color in any way :(
BTW, trick with gtk2 subsystem also doesn't works on RP :(

Best Wishes.
Mac Studio M1Max, PB 6.12 Arm64 and x64.
Macbook Air M2, PB 6.12 Arm64 and x64.
Windows 10, PB 6.12 x64 and x86.
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by Shardik »

dibor wrote: Fri Dec 03, 2021 12:24 am Impossible to change window color in any way :cry:
I have just tried my original code example to change the window's background color (which should work on all GTK3 versions) and it works like a charm on my Raspberry Pi 400.

mk-soft's code from the 1st posting in this thread doesn't work with the new C backend because it contains assembler instructions which PureBasic 6.00 Beta 1 still can't handle.
User avatar
mk-soft
Always Here
Always Here
Posts: 6205
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by mk-soft »

Update v1.04.2
- Bugfix ASM-Code to C-Code (PB v6.00)

Please test update for C-Code on Raspberry Pi. On Ubuntu work fine.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by Shardik »

mk-soft wrote: Sat Dec 04, 2021 1:46 pm - Bugfix ASM-Code to C-Code (PB v6.00)

Please test update for C-Code on Raspberry Pi. On Ubuntu work fine.
Thank you for the quick bugfix. But using GtkGadgetColor::GtkSetWindowColor(Window, Color) still doesn't work on Raspberry Pi because GtkGadgetColor::CSSColorString(Color) always returns #FFFFFF (tested with #Yellow and #White).
User avatar
mk-soft
Always Here
Always Here
Posts: 6205
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by mk-soft »

Sorry,

Update v1.04.2
- Bugfix ASM-Code to C-Code (PB v6.00)
- Filter $00FFFFF added after scrolled swaped value

Please test

Edit
I don't have a 32bit at time, but i think this solved the problem
Last edited by mk-soft on Sat Dec 04, 2021 2:47 pm, edited 1 time in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by Shardik »

mk-soft wrote: Sat Dec 04, 2021 2:34 pm - Filter $00FFFFF added
Now setting the background color is also correctly working on the Raspberry Pi. Thank you!
User avatar
mk-soft
Always Here
Always Here
Posts: 6205
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by mk-soft »

Update v1.04.3
- Bugfix ASM-Code to C-Code (PB v6.00)
- Bugfix 32 bit
- Bugfix CSSColorStringAlpha

There was a hidden bug in CSSColorStringAlpha. However, the function has not yet been used.

It's nice that the "__builtin_xxx" also works under Raspberry Pi.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
dibor
Enthusiast
Enthusiast
Posts: 160
Joined: Wed May 20, 2020 5:19 pm
Location: The 3rd planet in the Solar System
Contact:

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by dibor »

Thank you very much!!
Now is WORKS on RP :)
Mac Studio M1Max, PB 6.12 Arm64 and x64.
Macbook Air M2, PB 6.12 Arm64 and x64.
Windows 10, PB 6.12 x64 and x86.
User avatar
mk-soft
Always Here
Always Here
Posts: 6205
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by mk-soft »

Update v1.04.4
- Optimize ASM/C code


Thanks for replies :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
eck49
Enthusiast
Enthusiast
Posts: 153
Joined: Sat Nov 14, 2020 10:08 pm
Location: England

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by eck49 »

A great piece of work and well out of my league to do.

Any chance of completing the ContainerGadget case soon?
Ubuntu 22.04 64-bit
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
User avatar
mk-soft
Always Here
Always Here
Posts: 6205
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: GTK3 SetGadgetColor Workaround (Teamwork / Release)

Post by mk-soft »

Update v1.05.1
- Chance: SetSelectedColor parameters for front and back color
- Remove: SetSelectionColor
- Added: Hook PB FreeGadgetProg for release Gadget CSS Provider (Save CSS Provider on object data)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply