Change DzPushButton Color (background and text) [SOLVED]

V3DigitimesV3Digitimes Posts: 3,097

Since this morning I've been struggling to change the color (background and text) of one single DzPushButton of my interface (which is an important button that I would like to make more visible). I tried to tune it using the palette (its own, then a dzgroupbox it's in), or using the setBackgroundColor and similar functions, but I never manage to have its color changing. So I wonder if it is possible or not. If not, I'll see if I can do this via an image (thinking about it, it would have been faster finally... I think it's gonna end like that).

Post edited by V3Digitimes on

Comments

  • Richard HaseltineRichard Haseltine Posts: 99,279

    The primitive (for background) and textStyle (for text) properties allow you to specify which components of the "current" style to apply - this allows the styling of the button to follow the styling of the rest of the application. If you have a (typically single) button that is of "special interest", there is a primitive/textStyle designed specifically for this purpose (e.g., the blue/green, by default, button in the top right corner of the Draw/Render/Simulation Settings panes) - i.e., "DZ_SpecialInterestButton".

  • V3DigitimesV3Digitimes Posts: 3,097

    Thank you so much richard!!! It worked perfectly. I had had a rapid look before I came here the primitive and textStyle, but was clueless concerning what string I could have used with it, so I gave it up... now I know, and it's perfect for the "special interest" button I wanted to have :) Thanks you!

  • Richard HaseltineRichard Haseltine Posts: 99,279

    Heh, I was just the messenger - hence putting it in a quote.

  • V3DigitimesV3Digitimes Posts: 3,097

    You're an excellent messenger :) I also thank the message sender.. Plus, it allowed me to find a way to catch the list of all styles available for primitives, playing with them right now (just to discover the range of accessible primitives for buttons, cos I'm curious: I am now playing with the full black button where the text only appears when the mouse is on it))!

  • Richard HaseltineRichard Haseltine Posts: 99,279

    Don't use anything that isn't named as a button primitive on a button - even if it works now it is not guaranteed to work in future.

  • V3DigitimesV3Digitimes Posts: 3,097

    Understood. That was my final choice anway :)

Sign In or Register to comment.