set(h, 'BackgroundColor', 'Black') - Not working in Linux
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm making a gui with several edittexts. I would like these to have a black background and white text. First I tried to simply set this in the GUI editor (Guide), but it didn't seem to work, since they start out being disabled. Then i tried adding a function which adjust them, when they are activated. The code goes like this:
set(handles.editXoffset, 'BackgroundColor', 'Black',...
'ForegroundColor', 'White');
This works fine on windows machines, but on Linux, both background color and font color is shown as white. Looking in the properties, using:
get(hObject)
...in the edittexts callback, it shows this:
BackgroundColor = [0 0 0]
...
ForegroundColor = [1 1 1]
...
So it seems to be getting what I tell it, but it just don't show. What am I doing wrong here?
2 个评论
Daniel Shub
2012-4-11
Is what you are doing similar to executing uicontrol('Style', 'Edit', 'String', 'Hello', 'BackgroundColor', 'Black', 'ForegroundColor', 'White'); in the command window?
采纳的回答
Jan
2012-4-11
The operating system can override the specified colors, and obviously it does under your Linux platform. Which Matlab and OS version are you using?
更多回答(1 个)
Daniel Shub
2012-4-15
If I run
uicontrol('Style', 'Edit', 'String', 'Hello', 'BackgroundColor', 'Black', 'ForegroundColor', 'White')
I get a black box with white text with r2011a and Arch Linux.
Are you fonts installed correctly? href=""<http://www.mathworks.com/matlabcentral/answers/1238-font-size-changes-in-figures</a>>
5 个评论
Jan
2012-4-20
I suggest to give up. This will vanish if you install a higher Matlab release. And until then, the users will not suffer. It is impossible to create really nice GUIs with Matlab at all, so this detail is not a killer.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!