Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: backgroundcolor of menubar and toolbar

Subject: backgroundcolor of menubar and toolbar

From: Jette

Date: 21 Aug, 2007 13:43:19

Message: 1 of 3

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

Subject: backgroundcolor of menubar and toolbar

From: Craig Hamilton

Date: 29 Oct, 2007 01:38:39

Message: 2 of 3

"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???




Subject: backgroundcolor of menubar and toolbar

From: Yair Altman

Date: 29 Oct, 2007 10:11:45

Message: 3 of 3

"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

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
undocumented Yair Altman 29 Oct, 2007 06:15:26
color Jette 21 Aug, 2007 09:45:04
toolbar Jette 21 Aug, 2007 09:45:04
menubar Jette 21 Aug, 2007 09:45:04
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics