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:
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

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