fastlink30 Posted November 1, 2015 Report Share Posted November 1, 2015 maybe stupid question, but how to change color of label text from code?thanks Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted November 1, 2015 Report Share Posted November 1, 2015 Definitely not a stupid question The default rendering function of the label widget uses the text color of the currently active widget style. Therefore, In order to set an individual text color to a label widget you have to create a widget style and apply it to the label widget using gwinSetStyle().Writing this I just realize that there is no article in the wiki explaining widget styles... I put that on our ToDo list. Until then: Have a look at the two default built-in widget styles to see how you can create them: https://bitbucket.org/Tectu/ugfx/src/69 ... idget.c-29As you can see a widget style is nothing but a struct containing a bunch of colors.Note 1: In a similar fashion you can apply a specific font to your label so the label uses a font different than the GWIN default font. For this, use gwinSetFont().Note 2: If you want to have some more control over the look of your widgets you can always create a custom rendering routine and apply it to either one or multiple widgets of the same type. This article will help you writing your own rendering function: http://wiki.ugfx.org/index.php?title=Cr ... ng_routineNote 3: The uGFX-Studio already provides a GUI to create your own widget styles and generates the code for you.If you have any questions regarding the implementation of widget styles or the implementation of custom rendering functions please do not hesitate to ask.~ Tectu Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted November 2, 2015 Report Share Posted November 2, 2015 We just added some documentation for widget styles to the wiki: http://wiki.ugfx.org/index.php?title=Wi ... dget_Style~ Tectu Link to comment Share on other sites More sharing options...
fastlink30 Posted November 2, 2015 Author Report Share Posted November 2, 2015 thanks Link to comment Share on other sites More sharing options...
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