Path: news.mathworks.com!not-for-mail
From: "Shanmugam Kannappan" <shanmugambe@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to change icon in a toolbar?
Date: Sun, 9 Aug 2009 03:54:01 +0000 (UTC)
Organization: Tata Elxsi
Lines: 19
Message-ID: <h5lh8p$3a4$1@fred.mathworks.com>
References: <a3ccc1fb-30c1-490b-858a-9d25720fb115@u38g2000pro.googlegroups.com>
Reply-To: "Shanmugam Kannappan" <shanmugambe@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1249790041 3396 172.30.248.37 (9 Aug 2009 03:54:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 9 Aug 2009 03:54:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1441885
Xref: news.mathworks.com comp.soft-sys.matlab:561892


damayi <damayi@gmail.com> wrote in message <a3ccc1fb-30c1-490b-858a-9d25720fb115@u38g2000pro.googlegroups.com>...
> Dear all
> As you know, an icon can be choose or set in GUIDE, and it is a fixed
> icon. I want to change the icon when the GUI runs, how to change icon
> in a toolbar when it is running?
> 
> Best Regard
> mayi
> 2009-8-9
Hi!

CData property is the one used to set the icon.
ex:
set(handles.pushbutton1,'CData',rand(16,16,3))% write this in pushbutton2 callback

or
If you have the image then use imread('ImageName') instead of rand...

Shan.....