Placing UIPanel on Figure in OpeningFcn
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Michael Critchfield
am 2 Jun. 2017
Kommentiert: Michael Critchfield
am 2 Jun. 2017
Hello, I am trying to create an uipanel on a figure during the OpeningFcn using the following line:
bp = uipanel('Units','pixels','Position','[8 41 490 500],'Tag','BackgroundPanel','BorderType','none');
The Panel is created but it's placed on the calling figure. I tried several Parent settings but so far haven't come up with something working so the Panel is on the opening figure.
Can anybody help me with this please?
Best regards, Michael
1 Kommentar
Adam
am 2 Jun. 2017
Bearbeitet: Adam
am 2 Jun. 2017
It would be more useful to show a version with the parent that you tried that didn't work. The above attempt certainly doesn't specify a parent and will end up in the wrong place if you open this figure from another figure.
Trying the obvious parent, as in Jan's answer works fine for me in a figure that is not launched from another, but should equally work fine however it is launched.
Akzeptierte Antwort
Jan
am 2 Jun. 2017
Inside the OpeningFcn:
bp = uipanel('Units','pixels','Position','[8 41 490 500], ...
'Tag','BackgroundPanel','BorderType','none', ...
'Parent', hObject);
This seems to be the most obvious parent. What did you try?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!