Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

help with gui

Srt252Srt252 Posts: 2Member
so i need to make a gui with 2 push buttons, one that increments a counter displayed in a text box and one that clears the count. the only problem is that im not entirely sure how to work the clear button out... im using a persistent variable in the first push button function to increment the counter, but since its a persistent variable only that function can use it, so when i clear the counter with the 2nd push button, the text diplays 0, but next time it is incremented it will resume at whatever number it was on.
-this is for an assignment by the way, i need to email only the .fig and .m files, so i cant create a new m-file

Comments

  • rinoobrinoob Posts: 14Member
    : so i need to make a gui with 2 push buttons, one that increments a
    : counter displayed in a text box and one that clears the count. the
    : only problem is that im not entirely sure how to work the clear
    : button out... im using a persistent variable in the first push
    : button function to increment the counter, but since its a persistent
    : variable only that function can use it, so when i clear the counter
    : with the 2nd push button, the text diplays 0, but next time it is
    : incremented it will resume at whatever number it was on.
    : -this is for an assignment by the way, i need to email only the .fig
    : and .m files, so i cant create a new m-file
    :
    what language are you using?
    does your professor allow global variables?
    if not pass by reference between the two functions.

  • Srt252Srt252 Posts: 2Member
    : : so i need to make a gui with 2 push buttons, one that increments a
    : : counter displayed in a text box and one that clears the count. the
    : : only problem is that im not entirely sure how to work the clear
    : : button out... im using a persistent variable in the first push
    : : button function to increment the counter, but since its a persistent
    : : variable only that function can use it, so when i clear the counter
    : : with the 2nd push button, the text diplays 0, but next time it is
    : : incremented it will resume at whatever number it was on.
    : : -this is for an assignment by the way, i need to email only the .fig
    : : and .m files, so i cant create a new m-file
    : :
    : what language are you using?
    : does your professor allow global variables?
    : if not pass by reference between the two functions.
    :
    :
    i got it, i was just having trouble passing the data through the handles, but it works now. thanks
Sign In or Register to comment.