Push button to halt a loop

  • Permalink
  • submit to reddit
  • Email
  • Follow


Hello.

Is there a way to code up a GUI that gracefully brings a program out of a loop (i.e to avoid using Ctrl + C)?
Something like:

a = 1;

while a ==1
....run and plot this...
'GUI code which sets a=0 when button is pressed' (thus ending the loop).
end

I'm trying to find a way to run a program indefinitely until a key/button is pressed.
0
Reply theguv81 (25) 5/30/2011 6:17:02 AM

See related articles to this posting


On May 30, 8:17=A0am, "Frank " <thegu...@hotmail.com> wrote:
> Hello.
>
> Is there a way to code up a GUI that gracefully brings a program out of a=
 loop (i.e to avoid using Ctrl + C)?
> Something like:
>
> a =3D 1;
>
> while a =3D=3D1
> ...run and plot this...
> 'GUI code which sets a=3D0 when button is pressed' (thus ending the loop)=
..
> end
>
> I'm trying to find a way to run a program indefinitely until a key/button=
 is pressed.

You don't really want to do that, but the way to achieve
this is to start the GUI component where the button appears
before you enter the loop, and then poll the state of the
button in each iteration of the loop.

Rune
0
Reply allnor (8506) 5/30/2011 6:22:58 AM

On 5/29/2011 11:17 PM, Frank wrote:
> Hello.
>
> Is there a way to code up a GUI that gracefully brings a program out of a loop
>(i.e to avoid using Ctrl + C)?
> Something like:
>
> a = 1;
>
> while a ==1
> ...run and plot this...
> 'GUI code which sets a=0 when button is pressed' (thus ending the loop).
> end
>
> I'm trying to find a way to run a program indefinitely until a key/button is pressed.

Yes, ofcourse, I do that all the time.  Very easy, like this:

have a STOP button. In its call back, read your userData struct
from figure (doc userData), which you'd already set up, and
set a flag in it to true, say STOP=true. Then save the userData
back.

The mainline (your loop), will, at the end of each iteration,
read userData and checks if the flag is true of false, if it
is true, it terminates the loop, and sets the flag to false
to be ready for the next time the mainline is called,
and then write userData back to figure. Something like

  moreWork = true;
  while moreWork

     .... busy work here
     .... if done, moreWork=false;

     %check if user hit STOP button
     userData = get(handles.figure1, 'UserData');
     if userData.state == STOP
        userData.state = RUN;  %reset for next time
        set(handles.figure1,'UserData',userData);
        moreWork = false; %to stop the loop
     end
end


Do not need to worry about race conditions between Stop button
callback and mainline, as main line will be interrupted untill
stop button callback is completed (matlab takes care of this).

Initially, in your GUI OpeningFcn (if you are using GUIDE), you'll
set up the userData struct and init this flag to false.

--Nasser

0
Reply Nasser 5/30/2011 6:38:47 AM

I thought maybe I should re-write this again to include  the
whole setup to make things more clear.

In OpeningFcn(), if using GUIDE, do
-------------------------------------------
   set(handles.figure1, 'UserData',[]);
   userData.stop = false;
   set(handles.figure1, 'UserData',userData);

In the STOP button callback, do  (this is the interrupt)
-----------------------------------
    userData = get(handles.figure1, 'UserData');
    userData.stop = true;
    set(handles.figure1,'UserData',userData);


In the mainline, (the RUN button callback) do
---------------------------------------------

     moreWork = true;
     while moreWork
  
        .... busy work here
        .... if done, moreWork=false;
  
         %check if user hit STOP button
         userData = get(handles.figure1, 'UserData');
         if userData.stop == true
            userData.stop = false;  %reset for next time
            set(handles.figure1,'UserData',userData);
            moreWork = false; %to stop the loop
         end
     end

  
--Nasser
0
Reply Nasser 5/30/2011 6:56:56 AM

Thanks Nasser for you're fast response. 
0
Reply theguv81 (25) 6/1/2011 1:21:02 AM

"Frank" wrote in message <is445u$qhn$1@newscl01ah.mathworks.com>...
> Thanks Nasser for you're fast response. 

Sorry, Nasser: 

I tried something like what you suggested. Actually I did it almost the same way before reading your post. With no success. To me this does not work.

The main loop always takes control until the simulation is done. The stop callback is queued and acts only after the main loop terminates. I am not able to find a workaround.

Am I missing anything?
0
Reply msiti (2) 1/17/2012 2:08:09 PM

On 1/17/2012 8:08 AM, Azimut wrote:
> "Frank" wrote in message<is445u$qhn$1@newscl01ah.mathworks.com>...
>> Thanks Nasser for you're fast response.
>
> Sorry, Nasser:
>
> I tried something like what you suggested. Actually I did it almost the same way
>before reading your post. With no success. To me this does not work.
>
> The main loop always takes control until the simulation is done. The stop callback
>is queued and acts only after the main loop terminates. I am not able to find a workaround.
>
> Am I missing anything?

humm.. I am sorry, I have no idea what are you refering to. I see
nothing in this message I can respond to.

--Nasser
0
Reply Nasser 1/17/2012 2:30:07 PM

The point is that the structure you suggested:

run_Callback
    userData = get(handles.figure1, 'UserData');
    if (userData.stop == true)
        userData.stop = false; %reset for next time
        set(handles.figure1,'UserData',userData);
        abort_simulation;
    end
simulation_loop;

stop_Callback %pushbutton
userData = get(handles.figure1, 'UserData');
userData.stop = true;
set(handles.figure1,'UserData',userData);

practically does not work, even though it should. Matlab apparently is not able to get the status update from "stop callback", perhaps because too busy with simulating the intensive "simulation_loop" called from "run_Callback".

However I found a trick to give Matlab time to check stop_Callback updates.
The code example above works if a statement like: pause(0.000001) is placed among run_Callback instructions.

(I found this trick in another thread, not my idea; at least in my case it works)
0
Reply msiti (2) 1/17/2012 3:07:09 PM

On 1/17/2012 9:07 AM, Azimut wrote:
> The point is that the structure you suggested:
>
> run_Callback
>      userData = get(handles.figure1, 'UserData');
>      if (userData.stop == true)
>          userData.stop = false; %reset for next time
>          set(handles.figure1,'UserData',userData);
>          abort_simulation;
>      end
> simulation_loop;
>
> stop_Callback %pushbutton
> userData = get(handles.figure1, 'UserData');
> userData.stop = true;
> set(handles.figure1,'UserData',userData);
>
> practically does not work, even though it should. Matlab apparently is
>not able to get the status update from "stop callback", perhaps because
>too busy with simulating the intensive "simulation_loop" called from "run_Callback".
>
> However I found a trick to give Matlab time to check stop_Callback updates.
> The code example above works if a statement like: pause(0.000001) is placed among run_Callback instructions.
>
> (I found this trick in another thread, not my idea; at least in my case it works)

First, I am glad things worked for you.

Second, I have no clue where the above code with 'abort_simulation' came
from, becuase I did not write that. Here is the link:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/308463

Third, I gave you a pattern to follow, a general approach. I did not include
all the details and every thing. If you asked for more details, I would have
given you a link to an example code I did, here is one

Here is just one example showing how it works

http://12000.org/my_courses/UC_davis/spring_2011/MAE_121_eng_dynamics/lab/lab_one/index.htm

click on the HTML link there, and click on the source code. And yes, I did
use a pause for tiny amount to get this to run, I never said I did not as I was
just giving you a pattern, not an actual code with all the details. I did
not think I had to include every bit of everything each time I answer something.

But it is not important now. Since it works for you know.

--Nasser
0
Reply Nasser 1/17/2012 3:34:42 PM

Instead of "pause(0.0001)", use "drawnow;". "pause" command is extremely slow because it uses very inaccurate timing mechanism. If you're running a time-critical loop, NEVER use "pause" in your loop. Having said that, drawnow is not a perfect choice either. However, there is no delay. Only the overhead to process "drawnow" exists. So, if you're not running many GUI objects doing this and that, "drawnow" exits fairly well. In a very fast computer you may finish "drawnow" within 0.1ms, which is good for usual task.

Best,


"Azimut" wrote in message <jf42qt$8ni$1@newscl01ah.mathworks.com>...
> The point is that the structure you suggested:
> 
> run_Callback
>     userData = get(handles.figure1, 'UserData');
>     if (userData.stop == true)
>         userData.stop = false; %reset for next time
>         set(handles.figure1,'UserData',userData);
>         abort_simulation;
>     end
> simulation_loop;
> 
> stop_Callback %pushbutton
> userData = get(handles.figure1, 'UserData');
> userData.stop = true;
> set(handles.figure1,'UserData',userData);
> 
> practically does not work, even though it should. Matlab apparently is not able to get the status update from "stop callback", perhaps because too busy with simulating the intensive "simulation_loop" called from "run_Callback".
> 
> However I found a trick to give Matlab time to check stop_Callback updates.
> The code example above works if a statement like: pause(0.000001) is placed among run_Callback instructions.
> 
> (I found this trick in another thread, not my idea; at least in my case it works)
0
Reply sskimbox (22) 1/25/2012 10:26:10 PM

"Frank" wrote in message <irvcou$hv$1@newscl01ah.mathworks.com>...
> Hello.
> 
> Is there a way to code up a GUI that gracefully brings a program out of a loop (i.e to avoid using Ctrl + C)?
> Something like:
> 
> a = 1;
> 
> while a ==1
> ...run and plot this...
> 'GUI code which sets a=0 when button is pressed' (thus ending the loop).
> end
> 
> I'm trying to find a way to run a program indefinitely until a key/button is pressed.

function rotate_triangle()
axes('units','normalized',...
     'position',[0.1 0.1 0.8 0.8],...
     'color',[0.5 0.5 0.5],...
     'NextPlot','replacechildren',...
     'tag','plot_axes');
hp = plot([1 3 2 1],[2 4 1 2]);
set(hp,'tag','tplot');
xlim([-8 8]);
ylim([-8 8]);
% define rotation button
uicontrol('units','normalized',...
    'position', [0.42 .925 .15 .05],...
    'style','push',...
    'SelectionHighlight','off',...
    'string','rotate',...
    'fontweight','bold',...
    'fontsize', 10,...
    'fontname','arial',...
    'foregroundcolor',[0 0 0],...
    'callback',{@rotate_button},...
    'tag','rotate_button');

function rotate_button(hload,eventdata)
% locate and delete the main figure object
ax = findobj('tag','plot_axes');
hp = findobj('tag','tplot');
hb = findobj('tag','rotate_button');
stop_flag = get(hp,'userdata');
if ~isempty(stop_flag)
    if stop_flag == 0
        set(hp,'userdata',1)
        set(hb,'string','rotate');
    elseif stop_flag == 1
        set(hp,'userdata',0);
        set(hb,'string','stop');
    end
else
    set(hp,'userdata',0)
    set(hb,'string','stop');
end
t = hgtransform('Parent',ax);
set(hp,'Parent',t)
Rz = eye(4);
for r = 0:.1:2000*pi
    Rz = makehgtform('zrotate',r);
    set(t,'Matrix',Rz)
    drawnow
    pause(0.01)
    stop_flag = get(hp,'userdata');
    if stop_flag == 1
        break
    end
end
return
0
Reply nospam185 (247) 1/25/2012 11:27:09 PM

Thanks, Sung Soo.

drawnow is perfect for my purpose.
I think the picture is complete now.

best regards, A.



"Sung Soo Kim" <sskimbox@aol.com> wrote in message <jfpvi2$b50$1@newscl01ah.mathworks.com>...
> Instead of "pause(0.0001)", use "drawnow;". "pause" command is extremely slow because it uses very inaccurate timing mechanism. If you're running a time-critical loop, NEVER use "pause" in your loop. Having said that, drawnow is not a perfect choice either. However, there is no delay. Only the overhead to process "drawnow" exists. So, if you're not running many GUI objects doing this and that, "drawnow" exits fairly well. In a very fast computer you may finish "drawnow" within 0.1ms, which is good for usual task.
> 
> Best,
> 
> 
> "Azimut" wrote in message <jf42qt$8ni$1@newscl01ah.mathworks.com>...
> > The point is that the structure you suggested:
> > 
> > run_Callback
> >     userData = get(handles.figure1, 'UserData');
> >     if (userData.stop == true)
> >         userData.stop = false; %reset for next time
> >         set(handles.figure1,'UserData',userData);
> >         abort_simulation;
> >     end
> > simulation_loop;
> > 
> > stop_Callback %pushbutton
> > userData = get(handles.figure1, 'UserData');
> > userData.stop = true;
> > set(handles.figure1,'UserData',userData);
> > 
> > practically does not work, even though it should. Matlab apparently is not able to get the status update from "stop callback", perhaps because too busy with simulating the intensive "simulation_loop" called from "run_Callback".
> > 
> > However I found a trick to give Matlab time to check stop_Callback updates.
> > The code example above works if a statement like: pause(0.000001) is placed among run_Callback instructions.
> > 
> > (I found this trick in another thread, not my idea; at least in my case it works)
0
Reply mr_x0 (2) 1/26/2012 9:16:09 AM
comp.soft-sys.matlab 205332 articles. 554 followers. Post

11 Replies
323 Views

Similar Articles

[PageSpeed] 49


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Simulink
Hi all, May i have your advise how can i start my SIMULINK with a push button callback and stop the SIMULINK with another push button callback? Then before the Simulink is stopped by the 2nd push button, how can i export/send my SIMULINK result to a function that i have defined in workspace? Says that i have defined a function analyse.m for further process.. Many Thanks! "st " <cell_st@hotmail.com> wrote in message <ij5l0j$eco$1@fred.mathworks.com>... > Hi all, > > May i have your advise how can i start my SIMULINK with a push button callback and ...

Exit from a loop using push button
Dear all Please let me know how to exit from a loop using pushbutton in matlab gui? Thanks Praveen Praveen <praveenmn1@gmail.com> wrote in message <5a21b456-6b0d-4100-9795-34956947cae8@k5g2000pra.googlegroups.com>... > Dear all > > Please let me know how to exit from a loop using pushbutton in matlab > gui? > > Thanks > Praveen Something along these lines: % create a figure with a button figure ; ButtonHandle = uicontrol('style','push',... 'callback','set(gcbo,''userdata'',1,''string'','...

How to know which push button have been pushed ?
Hi, I have created two pushbuttons who refer to the same callback. How can i do to know if it's the push button 1 that has been pushed or the other ? Thanks Nono "Nono" <decatoirearnaud@hotmail.com> wrote in message news:4938541.1115041274879.JavaMail.jakarta@nitrogen.mathforum.org... > Hi, I have created two pushbuttons who refer to the same callback. How can > i do to know if it's the push button 1 that has been pushed or the other ? > Thanks > Nono Take a look at GCBO and GCO. Also, it's pretty easy to send the button object's handle as an a...

Push to Make (Single Pole) Button running a loop
Happy holidays all! I'm developing an application and, as a relative newbie to Python, have come across a stumbling block with Tkinter. I'd like to have a button that when pressed executes a loop (this could be a thread) and then stops execution when it's released (Push to Make - Single Pole in electronics terms). I've tried the regular way of associating the procedure with a callback and tried using <Button-1> and <ButtonRelease-1> bindings but am getting nowhere fast (in the latter case the button release event seems to occur anyhows). So my question is: ...

Event loop halts on mouse down over minimize, maximize and close buttons
When I mouse-down (left or right) on the minimize, maximize or close buttons my application stops processing events until mouse up. Once I mouse-up events are once again processed. Due to the nature of my program stopping event processing on mousedown is as good as an OS crash in that I have to restart the computer to get it back. Is this an MSW problem or a wxWidgets problem? Does anyone have any ideas how I can fix it or work around it? I have to be able to process events after a mouse-down before a mouse-up. On 29 Dec 2006 13:14:11 -0800 Micah <micahc@gmail.com> wrote: ...

Push button text changes when pushed down and up
How to get red button text if I click on it (where the value in the table will be -1) and remains red when pushed down, and remains black text in not pushed down, while browsing to the records? I have stored the value 0 and -1 in a column in the table. This is what I tried: Private Sub Toggle141_AfterUpdate() If Me.Toggle141.Value = 0 Then Me.Toggle141.ForeColor = 0 End If If Me.Toggle141.Value = -1 Then Me.Toggle141.ForeColor = 255 'red End If End Sub Private Sub Toggle141_Click() If Me.Toggle141.Value = 0 Then Me.Toggle141.ForeColor = 0 End If If Me.Tog...

how to connect a start button to a for loop and control the loop
hi everyone, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I need a small help regarding the VI. VI has two "for loops" the VI should run in such a way that when the first loop ends I need to get a flash&nbsp; signal saying that the first loop had ended. Then i need a start button for the second loop so that I can start the loop when ever it is needed. I would be really thankful if any one can reply this thread thanks deepthi krishnamaneni Hi, &nbsp;&nbsp;&nbsp; This is not exactly the same but hope it serves your purpose. For Loops.vi: http://forums.ni.c...

multiple radio buttons with a depending push button
I have a Matlab GUI with 2 radio buttons and one push button depends on the selected radio button . I want to program these buttons , also When the Matlab GUI starts, one radio button is default selected. note < Iam not good in matlab gui so if anyone has aprogram similar to this or had any idea please write the codes for his idea > "mohamed elsayed" <mohamed_elsayed_1989@yahoo.com> wrote in message <iqvst2$nt7$1@newscl01ah.mathworks.com>... > I have a Matlab GUI with 2 radio buttons and one push button depends on the selected radio button . I want to progra...

How to select a button in a matrix of push button (Cocoa) ?
The radion button was created with Interface Builder. How to make a default (selected) button in this matrix ? abz@videotron.ca (Alain Birtz) wrote in message news:<abz-2807030845040001@192.168.1.3>... > The radion button was created with Interface Builder. > How to make a default (selected) button in this matrix ? If I am understanding you correctly, you just need to send the matrix a - (void)selectCellAtRow:(int)row column:(int)column message to select the radio button at a given row and column in a matrix. If you don't want to deal with rows & columns you...

Radio Button Loop inside Form Element Loop
I have a for loop seen below.... var the_form = document.getElementById(formName); for(var i=0; i<the_form.length; i++) { var temp = the_form.elements[i].type; if (temp == "radio") { for (x = 0; x < the_form.elements[i].length - 1; x++) { //do stuff } } } Right before the inside loop I do the following and next to its the results, any idea why the last one returns 0? alert(the_form.elements[i].id); // returns question1 alert(the_form.question1.length); // returns 4 (amount of radio buttons in that group) alert(the_form.elements[i].length); // returns 0 I...

while loop in a while loop
Hi all, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I am trying to write a program with a while loop within another while loop. When I run the vi both while loops&nbsp; run but then only the inner while loop seems to update, I adjust controls and they have no effect on the indicators. &nbsp; Thanks.. The outer while loop will not update until the inner while loop finishes, at which point the whole dance will start again You need to familiarize with the concept of dataflow programming. Run your VI in "execution highligthing" mode while w...

LOOP and +LOOP
With LOOP, since the index (I) increases by 1 with each loop iteration, we can test for equality as a means to determine if it's time to exit the loop or not: : TEST 10 0 DO I . LOOP ; TEST 0 1 2 3 4 5 6 7 8 9 Here, when I gets to 10, the loop exits. It's not so easy with +LOOP, since the index can be changed by any arbitrary value on each iteration: : TEST 100 0 DO I . RANDOM +LOOP ; Here, we cannot test for equality. We have to test for crossing a boundary instead, at least as far as I can see. With that in mind, are these following results correct: : TEST 10 0 DO I . 1 +LOOP ...

while loop in a while loop
Hi All, I have the following situation: while(rs.next()) { //loop1 while(rs2.next()) { //loop 2 } } It seems like loop 2 is only beeing used once. Should I after loop2 put the cursor back to the beginning? if so, how do I do that? Thanks! -- Posted by news://news.nb.nu Steven wrote: > Hi All, > > I have the following situation: > > > while(rs.next()) { //loop1 > > while(rs2.next()) { > //loop 2 > } > > } > The architypal loop (for a List eg ArrayList of Blah objects) is: for(It...

For loop over a while loop
Hi, I am computing a quantity that depends on two variables. The computation itself is iterative (i'm using 3 while loops to compute it). Now i want to do a sensitivity analysis of the input variables and do a 3D plot where I can start making sense out of my results, however not sure how to write a for loop over these while loops to compute different combinations of what I define as my parametric space for my two input variables. Thanks in advance, Vash Please add a code example and/or more specific question.... ...

For loop while loop
I need to evaluate a function from 0:200 then create an array of every 5th value in the 0:200 array using a for loop then using a while loop. I can't get the for loop to work at all because I cannot use >,< controllers, only an =. So I focused on the While loop: n=0:200;%creates 201 cell array from 0-200 x=n.^2+.25;%calculates x plotcol=(length(n)-1)/5;%=(201-1)/5=40 y=zeros(1,plotcol);%creates 1X40 vector col=1;%used for incrementing in while loop while col<=plotcol; y(1,col)=x(1,5*col); col=col+1; end Unfortunately the output starts at 16 when it should start ...

How can I exit a while loop while it is running if a button is pressed mid loop.
I have an acquisition loop reading data from a serial port. Because the timing of the signal can vary between a couple per second and one every few hours I have set the timeout to be hours. What this seems to have resulted in is that each time I press stop to end the program the loop is still waiting for the next value to be put onto the buffer before carrying out the rest of the loop and then stopping. With the next value going into the buffer being possibly three hours away it waits all this time before it completes the loop and stops. Is there any way to override everything else in the ...

Loop in a loop?
Hi, I'm new to Python and have come across a problem I don't know how to solve, enter com.lang.python :) I'm writing some small apps to learn the language, and I like it a lot so far. My problem I've stumbled upon is that I don't know how to do what I want. I want to do a loop in a loop. I think. I've got two arrays with some random stuff in, like this. array1 = ['one','two','three','four'] array2 = ['a','b','c','d'] I want to loop through array1 and add elements from array2 at the end, so it looks lik...

loop not looping
This should be relatively easy for someone more experienced to pick out what I'm doing wrong here...All I want is my loop to run as many times as there are .dat files in the specified directory. I've hacked up my code a bit just so i can get it to work and realize it's not as simple or efficient as it could be. My script only runs through the loop once and I can't figure out why it never loads 'binary_002.dat' and so on. thanks for your help counter_value = 1; %counter value set back to 0 when while loop = false slice_thicknessMM = 1.5; tf = isdir('C:\Documen...

pushed button
hi ! I have a button on mainform(F1) to open subform (F2). The problem is when i press the button for opening F2 to record, then i close F2, come back F1, the button is PUSHED STATUS. i want to see the button rised for next action. any help with thanks ! luanhoxung wrote: > hi ! > I have a button on mainform(F1) to open subform (F2). > The problem is when i press the button for opening F2 to record, then i > close F2, come back F1, the button is PUSHED STATUS. > i want to see the button rised for next action. > > any help with thanks ! Are you using a toggle button or...

loops in loops
In the attached vi, the one second loop runs at one second and can't be touched.&nbsp; In the ten second loop, the ten second clock is a stand in for a process that generates a finished signal. The problem is once the process is complete, to start it again, leave the one second loop running, and start an additional process that will take less time than 10 seconds. thanks internal loops.vi: http://forums.ni.com/attachments/ni/170/319512/1/internal loops.vi Hi exo, what do you try there? If you start your vi, the value from your stop button will be read and after that, both loops &quo...

for loop into for loop.
Hello this is my first time that i am writing here.. I need your help to improve my code. This is my code for a=1:numberOfShortestPaths for b=a+1:a+numberOfShortestPaths for c=b+1:b+numberOfShortestPaths for d=c+1:c+numberOfShortestPaths for e=d+1:d+numberOfShortestPaths total_weight=weight(:,:,a)+weight(:,:,b)+weight(:,:,c)+weight(:,:,d)+weight(:,:,e); maximum=max(total_weight); end end end end end i want to do this function "automatically" because the letters ...

push button
Hi all , What i want is to get a PushButton wich contains text and a icon in it. Is it possible? TIA PAblo Pablo Digonzelli wrote: > Hi all , What i want is to get a PushButton wich contains text and a icon > in it. > Is it possible? Take a look at this thread: http://groups.google.com/groups?threadm=ba38af%24p7cr9%241%40ID-64746.news.dfncis.de I haven't tried either of Biil or Bruno's packages myself, but there should be something there to get you started. -- chris Thansk , Chris . I'll see it Thanks Pablo "Chris Uppal&q...

push button ??
I found a use for a (push) button the other day - having never wanted it before. I used button rather than input type=button, because I wanted to use an image for it. The html4 spec doesn't say anything explicit, though, about how/whether it gets submitted with the other 'successful controls'. In practice, using push buttons within a form, with name and value attributes, and some content (an image): Firefox doesn't submit it. ie6 submits the content (the html image tag), not the value. I was kind of hoping for the value, since I went to some trouble to set ...

how to keep push-appearnce of a button till another button is pressed
Hi, i have developed an ActiveX control(composite) using ATL COM,i have 3 button controls on ActiveX control,when i press any one of the 3 buttons i wanted to keep the push-appearance of tht button till i press on another button. can any help me in this regard.if any code snippets would be more helpful thanks in advance Regards Nani. > i have developed an ActiveX control(composite) using ATL COM,i have >3 button controls on ActiveX control,when i press any one of the 3 >buttons i wanted to keep the push-appearance of tht button till i press >on another but...