Thread Subject: How do I copy object properties in GUIDE ?

Subject: How do I copy object properties in GUIDE ?

From: vivek

Date: 6 Jan, 2009 01:08:02

Message: 1 of 2

Hello All !

I've been trying to do this all day but I cannot seem to find a solution.
Simply put, when I copy an object say a push button in GUIDE and then paste it somewhere else either in the same figure or a new figure, how can I get it to copy the properties of that object as well?

Only the 'visual' properties get copied. Others such as 'tag' 'callback' etc (the important ones) do not.

This would be very helpful when you are copying one gui into say the 'tab' of another. It would be really nice not to have to change the tags and callback names for each object!

related : Why did Mathworks remove the "duplicate" function ?

Thanks a lot!





Subject: How do I copy object properties in GUIDE ?

From: Jiro Doke

Date: 6 Jan, 2009 02:45:03

Message: 2 of 2

"vivek" <bhaskar.vivek@gmail.com> wrote in message <gjuath$puv$1@fred.mathworks.com>...
> Hello All !
>
> I've been trying to do this all day but I cannot seem to find a solution.
> Simply put, when I copy an object say a push button in GUIDE and then paste it somewhere else either in the same figure or a new figure, how can I get it to copy the properties of that object as well?
>
> Only the 'visual' properties get copied. Others such as 'tag' 'callback' etc (the important ones) do not.
>
> This would be very helpful when you are copying one gui into say the 'tab' of another. It would be really nice not to have to change the tags and callback names for each object!
>
> related : Why did Mathworks remove the "duplicate" function ?
>
> Thanks a lot!
>
>
>
>
>

That's the default behavior of components you create in GUIDE. *Usually*, I expect different UI objects to do different things. That's why GUIDE does not copy tags or callbacks. ("tags" are used by GUIDE to assign handles to unique components).

If you want the components to have the same tag, then you can overwrite this by selecting all the components, and changing the tag property in the property inspector. Then, with all the components selected, select "view callback", and it'll take you to the single callback.

BTW, the "duplicate" function still exists. Click on an object, go to the Edit menu and select "Duplicate". Or Control-D for a keyboard shortcut. (of course, this will duplicate the way GUIDE is designed to do).


jiro

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
guide Jiro Doke 5 Jan, 2009 21:59:20
copy Jiro Doke 5 Jan, 2009 21:59:20
uicontrol Jiro Doke 5 Jan, 2009 21:59:20
rssFeed for this Thread
 

MATLAB Central Terms of Use

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 Terms prior to use.

Contact us at files@mathworks.com