| MATLAB Function Reference | ![]() |
hpt = uipushtool('PropertyName1',value1,'PropertyName2',value2,...)
hpt = uipushtool(ht,...)
hpt = uipushtool('PropertyName1',value1,'PropertyName2',value2,...) creates a push button on the uitoolbar at the top of the current figure window, and returns a handle to it. uipushtool assigns the specified property values, and assigns default values to the remaining properties. You can change the property values at a later time using the set function.
Type get(hpt) to see a list of uipushtool object properties and their current values. Type set(hpt) to see a list of uipushtool object properties that you can set and their legal property values. See the Uipushtool Properties reference page for more information.
hpt = uipushtool(ht,...) creates a button with ht as a parent. ht must be a uitoolbar handle.
uipushtool accepts property name/property value pairs, as well as structures and cell arrays of properties as input arguments.
Uipushtools appear in figures whose Window Style is normal or docked. They do not appear in figures whose WindowStyle is modal. If the WindowStyleof a figure containing a uitoolbar and its uipushtool children is changed to modal, the uipushtools still exist and are contained in the Children list of the uitoolbar, but are not displayed until the figure WindowStyle is changed to normal or docked.
This example creates a uitoolbar object and places a uipushtool object on it.
h = figure('ToolBar','none')
ht = uitoolbar(h)
a = [.20:.05:0.95];
b(:,:,1) = repmat(a,16,1)';
b(:,:,2) = repmat(a,16,1);
b(:,:,3) = repmat(flipdim(a,2),16,1);
hpt = uipushtool(ht,'CData',b,'TooltipString','Hello')

get, set, uicontrol, uitoggletool, uitoolbar
![]() | Uipanel Properties | Uipushtool Properties | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |