Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Context Sensitive Help with a Ui Tab group

Subject: Context Sensitive Help with a Ui Tab group

From: jason

Date: 17 Aug, 2009 12:19:01

Message: 1 of 5

I've already asked this question on Yair Altman's website http://www.undocumentedmatlab.com in the comments, but i figured I would also open this up to the newsgroup.

I'm working on implementing a context sensitive help system for some of my programs, and they involve tab groups. Everything else works fine, but when I click on a tab group with context sensitive help enabled i get the following error:

??? No appropriate method or public field updateVisibility for class hg.hgjavacomponent.

Error in ==> uitools.uitabgroup.schema>onSelChanged at 211
        children(i).updateVisibility();

??? Error while evaluating com.mathworks.hg.peer.UITabGroupPeer$1

anyone have any ideas?
Thanks,
Jason

for more info on CS help see:
http://undocumentedmatlab.com/blog/context-sensitive-help/

Subject: Context Sensitive Help with a Ui Tab group

From: jason

Date: 2 Sep, 2009 16:57:04

Message: 2 of 5

for those interested, Yair posted a reply to this post on his blog (http://www.undocumentedmatlab.com), I've attached it here:

@Jason - the updateVisibility function is an m-file (%matlabroot%\toolbox\matlab\uitools\@uitools\@uitab\updateVisibility.m) that is responsible for hiding the previous tab’s components and unhiding the new tab’s components, whenever the active tab is changed (selected). Each tab is considered a “child” of the tabgroup and automatically has the updateVisibility() function defined as a private function. It appears that CSHelp adds extra children that do not have this updateVisibility() function defined.

I think the simplest workaround is simply to add a try-catch block around the offending line (%matlabroot%\toolbox\matlab\uitools\@uitools\@uitabgroup\schema.m line #211 [for Matlab R2008a]):

    try
        children(i).updateVisibility();
    catch
        % never mind...
    end

Subject: Context Sensitive Help with a Ui Tab group

From: Sherif Elnabarawy

Date: 20 Apr, 2010 14:35:06

Message: 3 of 5

i need to change the tab button's background color other than this white color to match the background of the gui ..
unfortunately i have to do this ..
any help to edit this java object ?!


Thanks in advance ,
Sherif Elnabarawy.

Subject: Context Sensitive Help with a Ui Tab group

From: Sherif Elnabarawy

Date: 20 Apr, 2010 14:36:06

Message: 4 of 5

i need to change the tab button's background color other than this white color to match the background of the gui ..
unfortunately i have to do this ..
any help to edit this java object ?!


Thanks in advance ,
Sherif Elnabarawy.

Subject: Context Sensitive Help with a Ui Tab group

From: Yair Altman

Date: 20 Apr, 2010 19:59:21

Message: 5 of 5

"Sherif Elnabarawy" <sherif223@hotmail.com> wrote in message <hqke4m$lf4$1@fred.mathworks.com>...
> i need to change the tab button's background color other than this white color to match the background of the gui ..
> unfortunately i have to do this ..
> any help to edit this java object ?!
>
>
> Thanks in advance ,
> Sherif Elnabarawy.

Theoretically, you would set the BackgroundColor property of the tab object - unfortunately this property is read-only (='none').

Theoretically again, you would get the Java handle of the tab-group using FindJObj utility (this returns a javahandle_withcallbacks.com.mathworks.hg.peer.FigureComponentContainer), move down the component's hierarchy to find the JTabbedPane component (a com.mathworks.hg.peer.UITabGroupPeer$1 object) and use its setBackgroundAt(tabIndex,jColor) method to set the background color. Unfortunately again, it seems that MathWorks modified com.mathworks.hg.peer.UITabGroupPeer$1 so that the white background remains and cannot be modified.

Bottom line - I don't know how this can be done. I will be happy to learn if someone does find a way to do this.

Yair Altman
http://UndocumentedMatlab.com

Tags for this Thread

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.

Contact us