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:
crazy " uicontrol "..... help

Subject: crazy " uicontrol "..... help

From: evan evan

Date: 27 Jan, 2011 22:51:03

Message: 1 of 7

code:


 TextBox = uicontrol('Style', 'text', 'String', 'Clear',...
               'Position', [380 400 140 20]);
           
                  set(TextBox,'BackgroundColor',[1 1 1]);
                  set(TextBox,'Units','normalized');
                
              if t(end) ~= 0
                
                                    
               ss=sprintf('The value is :%d',t(end));
               set(TextBox,'String',ss);

               end


--------------------------------------------------------------------------------

the figure looks good , but if u maximize the window or make it bigger , you will see the text in different places. please see snapshot below (first pic normal size, 2nd after maximizing the window) :

picture:
http://img690.imageshack.us/img690/6199/maxmax.jpg



---------------------------------------------------------------------------

What im doing wrong ! >? thanks in advance !

Subject: crazy " uicontrol "..... help

From: Matt Fig

Date: 28 Jan, 2011 01:33:04

Message: 2 of 7

In the first figure, there appears to be only one textbox, and in the second, three. So what is it you need, 1 or 3? If the three are in the first figure, just overlapping each other, then why do you need them?

Subject: crazy " uicontrol "..... help

From: evan evan

Date: 28 Jan, 2011 04:45:04

Message: 3 of 7

"Matt Fig" wrote in message <iht6cg$bhf$1@fred.mathworks.com>...
> In the first figure, there appears to be only one textbox, and in the second, three. So what is it you need, 1 or 3? If the three are in the first figure, just overlapping each other, then why do you need them?

there is more to the if statment .

if ...
 a
else if
b
else
C


if the window is small i see wone window and it keep refreshing.
if i maximize i get 3 of them . how to fix that ?

Subject: crazy " uicontrol "..... help

From: Think blue, count two.

Date: 28 Jan, 2011 11:57:50

Message: 4 of 7

On 27/01/11 4:51 PM, evan evan wrote:
> code:
>
> TextBox = uicontrol('Style', 'text', 'String', 'Clear',... 'Position',
> [380 400 140 20]); set(TextBox,'BackgroundColor',[1 1 1]);
> set(TextBox,'Units','normalized');
> if t(end) ~= 0 ss=sprintf('The value is :%d',t(end));
> set(TextBox,'String',ss);
> end
>
> --------------------------------------------------------------------------------
>
>
> the figure looks good , but if u maximize the window or make it bigger ,
> you will see the text in different places. please see snapshot below
> (first pic normal size, 2nd after maximizing the window) :
> picture:
> http://img690.imageshack.us/img690/6199/maxmax.jpg
>
>
>
> ---------------------------------------------------------------------------
>
> What im doing wrong ! >? thanks in advance !

Do not create a new uicontrol each time during the loop. Create it
*once*, and after that, set() its String property to the proper value
for the loop.

Subject: crazy " uicontrol "..... help

From: evan evan

Date: 29 Jan, 2011 04:50:05

Message: 5 of 7

"Think blue, count two." <roberson@hushmail.com> wrote in message <2by0p.21378$Tg1.17783@newsfe13.iad>...
> On 27/01/11 4:51 PM, evan evan wrote:
> > code:
> >
> > TextBox = uicontrol('Style', 'text', 'String', 'Clear',... 'Position',
> > [380 400 140 20]); set(TextBox,'BackgroundColor',[1 1 1]);
> > set(TextBox,'Units','normalized');
> > if t(end) ~= 0 ss=sprintf('The value is :%d',t(end));
> > set(TextBox,'String',ss);
> > end
> >
> > --------------------------------------------------------------------------------
> >
> >
> > the figure looks good , but if u maximize the window or make it bigger ,
> > you will see the text in different places. please see snapshot below
> > (first pic normal size, 2nd after maximizing the window) :
> > picture:
> > http://img690.imageshack.us/img690/6199/maxmax.jpg
> >
> >
> >
> > ---------------------------------------------------------------------------
> >
> > What im doing wrong ! >? thanks in advance !
>
> Do not create a new uicontrol each time during the loop. Create it
> *once*, and after that, set() its String property to the proper value
> for the loop.


im not. just one time !

 TextBox = uicontrol('Style', 'text', 'String', 'Clear',... 'Position',
 [380 400 140 20]); set(TextBox,'BackgroundColor',[1 1 1]);
set(TextBox,'Units','normalized');


 if t(end) ~= 0 ss=sprintf('The value is :%d',t(end));
 set(TextBox,'String',ss);
 
else if .......
...........
else
...........
end
end
end

Subject: crazy " uicontrol "..... help

From: Joseph

Date: 29 Jan, 2011 17:46:03

Message: 6 of 7

I am wondering if you figure's properties are set so it has normalized units as well...

"evan evan" <evan349343@yahoo.com> wrote in message <ii069t$3du$1@fred.mathworks.com>...
> "Think blue, count two." <roberson@hushmail.com> wrote in message <2by0p.21378$Tg1.17783@newsfe13.iad>...
> > On 27/01/11 4:51 PM, evan evan wrote:
> > > code:
> > >
> > > TextBox = uicontrol('Style', 'text', 'String', 'Clear',... 'Position',
> > > [380 400 140 20]); set(TextBox,'BackgroundColor',[1 1 1]);
> > > set(TextBox,'Units','normalized');
> > > if t(end) ~= 0 ss=sprintf('The value is :%d',t(end));
> > > set(TextBox,'String',ss);
> > > end
> > >
> > > --------------------------------------------------------------------------------
> > >
> > >
> > > the figure looks good , but if u maximize the window or make it bigger ,
> > > you will see the text in different places. please see snapshot below
> > > (first pic normal size, 2nd after maximizing the window) :
> > > picture:
> > > http://img690.imageshack.us/img690/6199/maxmax.jpg
> > >
> > >
> > >
> > > ---------------------------------------------------------------------------
> > >
> > > What im doing wrong ! >? thanks in advance !
> >
> > Do not create a new uicontrol each time during the loop. Create it
> > *once*, and after that, set() its String property to the proper value
> > for the loop.
>
>
> im not. just one time !
>
> TextBox = uicontrol('Style', 'text', 'String', 'Clear',... 'Position',
> [380 400 140 20]); set(TextBox,'BackgroundColor',[1 1 1]);
> set(TextBox,'Units','normalized');
>
>
> if t(end) ~= 0 ss=sprintf('The value is :%d',t(end));
> set(TextBox,'String',ss);
>
> else if .......
> ...........
> else
> ...........
> end
> end
> end

Subject: crazy " uicontrol "..... help

From: evan evan

Date: 29 Jan, 2011 18:18:03

Message: 7 of 7

how to check that .

i just use plot (x,'g')
             plot (y,'r')

...etc

"Joseph" wrote in message <ii1jor$j42$1@fred.mathworks.com>...
> I am wondering if you figure's properties are set so it has normalized units as well...
>
> "evan evan" <evan349343@yahoo.com> wrote in message <ii069t$3du$1@fred.mathworks.com>...
> > "Think blue, count two." <roberson@hushmail.com> wrote in message <2by0p.21378$Tg1.17783@newsfe13.iad>...
> > > On 27/01/11 4:51 PM, evan evan wrote:
> > > > code:
> > > >
> > > > TextBox = uicontrol('Style', 'text', 'String', 'Clear',... 'Position',
> > > > [380 400 140 20]); set(TextBox,'BackgroundColor',[1 1 1]);
> > > > set(TextBox,'Units','normalized');
> > > > if t(end) ~= 0 ss=sprintf('The value is :%d',t(end));
> > > > set(TextBox,'String',ss);
> > > > end
> > > >
> > > > --------------------------------------------------------------------------------
> > > >
> > > >
> > > > the figure looks good , but if u maximize the window or make it bigger ,
> > > > you will see the text in different places. please see snapshot below
> > > > (first pic normal size, 2nd after maximizing the window) :
> > > > picture:
> > > > http://img690.imageshack.us/img690/6199/maxmax.jpg
> > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------------
> > > >
> > > > What im doing wrong ! >? thanks in advance !
> > >
> > > Do not create a new uicontrol each time during the loop. Create it
> > > *once*, and after that, set() its String property to the proper value
> > > for the loop.
> >
> >
> > im not. just one time !
> >
> > TextBox = uicontrol('Style', 'text', 'String', 'Clear',... 'Position',
> > [380 400 140 20]); set(TextBox,'BackgroundColor',[1 1 1]);
> > set(TextBox,'Units','normalized');
> >
> >
> > if t(end) ~= 0 ss=sprintf('The value is :%d',t(end));
> > set(TextBox,'String',ss);
> >
> > else if .......
> > ...........
> > else
> > ...........
> > end
> > end
> > end

Tags for this Thread

No tags are associated with 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