|
"Craig Hamilton" <crhamilt.nospam@wfubmc.edu> wrote in
message <fg3div$mqv$1@fred.mathworks.com>...
> "Jette " <jette.schroeder@web.de> wrote in message
> <faeq5n$agk$1@fred.mathworks.com>...
> > Hi,
> >
> > I wonder whether there is a way to change the
> > backgroundcolor of a figure's menubar and toolbar? Both
> > seem to depend on the user's Windows settings (classical
> > style versus XP style) which I don't like. I would like
> to
> > set it to the same color as the figure's color.
> >
> > Thanks for any hints.
> >
> > Jette
> >
>
> I would love to see an answer to this question....
> anyone, anyone, Bueller???
Another one of those challenges that I simply cannot resist...
The following is entirely unsupported, undocumented, but
works on Matlab 7+:
1. Download my FindJObj utility from the File Exchange:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=14317
2. run the following:
c = get(gcf,'color');
% set the figure menu bg color
hmb=findjobj(gcf,'class','FigureMenuBar');
for idx=0:hmb.getComponentCount-1
hm=hmb.getComponent(idx);
hm.setBackground(java.awt.Color(c(1),c(2),c(3)));
end
for idx=0:hmb.getParent.getComponentCount-1
hm=hmb.getParent.getComponent(idx);
hm.setBackground(java.awt.Color(c(1),c(2),c(3)));
end
% set the figure toolbar bg color
htb=findjobj(gcf,'class','MJToolbar');
htb=findjobj(htb(1)); % get all decendents...
set(htb,'background',java.awt.Color(c(1),c(2),c(3)));
Yair Altman
http://ymasoftware.com
|