Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Problem with TreeView(uitree) and UIContextMenu
Replies: 6   Last Post: Feb 6, 2013 9:46 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Yair Altman

Posts: 1,352
Registered: 3/19/07
Re: Problem with TreeView(uitree) and UIContextMenu
Posted: Jan 30, 2013 3:16 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Dennis B." wrote in message <kebca8$9f8$1@newscl01ah.mathworks.com>...
> Hello Community,
>
> I have a small Problem setting up a my uiContextmenu for my TreeView(uitree):
>
> ------------------------------------------------------------------------
> Code:
>
> %Get Tree
> JavaTree_ja = hMainDlgTree_ja.getTree;
>
> %Create Context Menu
> hContextMenu = uicontextmenu('Tag','cmnu_TreeContextMenu');
>
> ...
> set(JavaTree_ja,'MouseClickedCallback','sc_maindlggui',hMainDlg,'mdtreenouseclick'});
> setappdata(JavaTree_ja,'UIContextMenu',hContextMenu);
> JavaTree_ja.setRightSelectionEnabled(1);
>
> ------------------------------------------------------------------------
>
> Because of using set-Function i get the Warning "MATLAB:hg:PossibleDeprecatedJavaSetHGProperty" (or "MATLAB:hg:JavaSetHGProperty" before Matlab 2012b).
> But setappdata seems not working for this property. The contextmenu does not popup.
>
> Also i found no java-property for access JavaTree_ja directly.
>
> Anyone an idea to do this without warnings?



1. warnings -
jObject = handle(JavaTree_ja, 'CallbackProperties');
set(jObject, ...)

2. getappdata - this was indeed removed for some inexplicable reason by MathWorks (I believe in R2012a). Use try/catch and/or the object's UserData or some other means of storing your data persistently. Bad, bad, MathWorks!

Yair Altman
http://UndocumentedMatlab.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.