Thread Subject: Problems with checkbox

Subject: Problems with checkbox

From: Matthias

Date: 2 Sep, 2010 22:52:04

Message: 1 of 4

Hi all,

I'm having an issue with the 'checkbox' in a GUI I'm working on. The problem is that regardless if the checkbox is marked or not, the handle always has the same value. The handle hcheckhold is always 4.0248... I need to have 2 different values! here's the code


hcheckhold = uicontrol('Style','checkbox','String','Hold',...
    'Min',0,'Max',1,...
    'Position',[10,10,10,10],...
    'FontSize',10,'Callback',{@checkbox_Callback})

function checkbox_Callback(source,eventdata)
        hcheckhold
end

Any help?

Subject: Problems with checkbox

From: Walter Roberson

Date: 3 Sep, 2010 00:23:58

Message: 2 of 4

On 10-09-02 05:52 PM, Matthias wrote:

> I'm having an issue with the 'checkbox' in a GUI I'm working on. The
> problem is that regardless if the checkbox is marked or not, the handle
> always has the same value. The handle hcheckhold is always 4.0248... I
> need to have 2 different values! here's the code
>
>
> hcheckhold = uicontrol('Style','checkbox','String','Hold',...
> 'Min',0,'Max',1,...
> 'Position',[10,10,10,10],...
> 'FontSize',10,'Callback',{@checkbox_Callback})
>
> function checkbox_Callback(source,eventdata)
> hcheckhold
> end
>
> Any help?

get(hcheckhold,'Value')

Subject: Problems with checkbox

From: Matthias

Date: 3 Sep, 2010 00:57:04

Message: 3 of 4

Thanks Walter,

I pasted it inside the function and it worked perfectly,

Thanks again

G

Subject: Problems with checkbox

From: Jan Simon

Date: 3 Sep, 2010 16:24:04

Message: 4 of 4

Dear Matthias,

> I'm having an issue with the 'checkbox' in a GUI I'm working on. The problem is that regardless if the checkbox is marked or not, the handle always has the same value. The handle hcheckhold is always 4.0248... I need to have 2 different values! here's the code

The problem is solved already.
Did it get clear, that the handle itself must not change its value? The handle is a unique pointer to the object, while the property 'Value' of the object can change its value.

Kind regards, Jan

Tags for this Thread

Everyone's Tags:

gui

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
gui Matthias 2 Sep, 2010 18:54:17
rssFeed for this Thread

Contact us at files@mathworks.com