|
Yair Altman wrote:
> Try running findjobj on hFig (not h), without any output:
> findjobj(hFig,'-nomenu');
>
> - this will display a GUI window with ALL the object in your
> figure, and I bet you can find the JTable buried somewhere
> in there. Once you find it, you can use its classname or
> other property to provide as extra params to findjobj, in
> order to get the relevant handle programmatically.
>
> Let us know what you find.
>
> Yair Altman
Yair,
I think I've found the difference, although I haven't looked deeply in
your code to see the difference. First, I did try your suggestion of
searching the handle of the GUI. In case someone's interested, this
seemed to work AFTER the GUI was made visible:
jt = findjobj(hFig, '-nomenu', 'class', 'uitablepeer');
where hFig is the handle the GUI figure. But you can also use the more
direct approach of just passing in the handle to the uitable at that
point and using the code I posted previously to get the viewport.
The problem I'm running into is that I am putting that line in the
opening function of the GUIDE gui. At the end of the OpeningFcn, the
GUI visibility is set to off. Well, findjobj doesn't return any results
if the figure visibility is off. As soon as I turn it on, it works as
expected.
I'm not sure that I'm going to be able to use the uitable anyway because
of its many limitations. I'm going to keep playing with it though. Not
sure where to put this function though if it doesn't work in OpeningFcn.
On a side note, your findjobj function gives lots of warnings in R2008a
about the javaframe property. There's not much you can do about it I
suppose unless the user suppress these warnings, which is what I do for
my code. But in R2008b, it gets lots more warnings and exceptions,
although it does make it through eventually. The uitreenode is being
added to a future release, so they've added a '-v0' switch in R2008b
like they did for the uitable. Also, your jidesoft table causes some
java exceptions with the built-in uitable because they're using it too
for the column headers or something.
Jesse
|