Set BackgroundColor to 'none'

9 visualizaciones (últimos 30 días)
Nicholas Hall
Nicholas Hall el 30 de Mayo de 2011
I'm receiving the following warning in code that I use liberally to auto-generate complex gui objects like a tab-panel. Warning: Setting the ColorSpec to 'none' for a uicontainer will not be allowed in a future release. Currently I set BackgroundColor to 'none' where I need an object to inherit it's parents color. Will there be replacement method to acheive this once this functionality has been removed? Setting background color to none is a useful method to distiguish between objects that inherit their parents color versus objects that at the moment just happen to have the same color.
  1 comentario
Walter Roberson
Walter Roberson el 31 de Mayo de 2011
I agree with your concern; I wonder why this is being done?

Iniciar sesión para comentar.

Respuestas (1)

Matt Fig
Matt Fig el 30 de Mayo de 2011
c = get(hparent,'color') % For a figure. 'backgroundcolor' for others.
set(hobj,'backgroundcolor',C)
  2 comentarios
Nicholas Hall
Nicholas Hall el 31 de Mayo de 2011
Hi Matt,
I know that method, however with that method all that hobj would know is the RBG color C, it would not know to stay set to whatever backgroundcolor hparent is or changes to. With the current functionality that I'm utilizing hobj knows to stay the color of its parent. My hope is to keep this type of functionality while maintaining concise and logical syntax.
-Nicholas
Matt Fig
Matt Fig el 31 de Mayo de 2011
This is the only workaround I know of without going to the Java. I know it is not ideal for all purposes, but at least this can be put into all code which changes the parent's color, after the change is made.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Exploration en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by