Jump to content

label color


fastlink30

Recommended Posts

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-29

As 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_routine

Note 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...