TheProdigalCat Posted December 23, 2017 Report Posted December 23, 2017 (edited) Hello guys. I'm playing with uGFX library. How I can fill my containers with diffrent background colors? For example I have 3 containers with buttons, labels and progressbars. I want fill container 1 red, container 2 green and container 3 blue color? How I can do i? Thanks. Edited December 23, 2017 by TheProdigalCat
Steffen Posted December 24, 2017 Report Posted December 24, 2017 For this you need to change the style either during the initialization or with gwinSetStyle. Something like this should work: const GWidgetStyle MyCustomStyle = { HTML2COLOR(0xFF0000), // window background }; GWidgetInit wi; // Apply some default values for GWIN gwinWidgetClearInit(&wi); // Apply the container parameters wi.g.show = FALSE; wi.g.width = 200; wi.g.height = 150; wi.g.y = 10; wi.g.x = 10; wi.text = "Container"; wi.customStyle = &MyCustomStyle; ghContainer = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); wi.g.show = TRUE; More info on styles is on https://wiki.ugfx.io/index.php/Widgets
Joel Bodenmann Posted December 26, 2017 Report Posted December 26, 2017 If you need more flexibility in the future you can also write custom rendering functions for the containers. That's described here: https://wiki.ugfx.io/index.php/Creating_a_custom_rendering_routine
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now