Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Flashing Buttons
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JamesV




PostPosted: Tue Jan 18, 2011 2:04 pm   Post subject: Flashing Buttons

What is it you are trying to achieve?
Im trying to remove the flashing effect on my buttons.


What is the problem you are having?
The buttons are flashing and I would like it to go away.


Describe what you have tried to solve this problem
I Haven't tried too much, I know that the problem lies somewhere with the Disabling of the Button inside the If, and the If inside the loop. I dont know why its flashing though because im not Enabling and then Disabling it.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

I cant post too much code because I don't want to make it look like I stole it.

Turing:


loop
        if numberofcards > 2 then
            GUI.Disable (double_button)
        end if
        exit when GUI.ProcessEvent ()
end loop



Please specify what version of Turing you are using
<Answer Here>
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Jan 18, 2011 2:21 pm   Post subject: RE:Flashing Buttons

Flashing results from excessive and/or slow redrawing of elements.

Having more than one cls or (cls + delay) could lead to such problems. First check that you don't have such cases.

View.Update will be suggested at some point, but make sure you understand exactly what it does, as it will cause problems if any of the buttons lead to procedures with loops or delays.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
JamesV




PostPosted: Tue Jan 18, 2011 5:23 pm   Post subject: Re: Flashing Buttons

Ok, thanks Smile. You helped me fix my problem Smile

So it was excessive disabling, that seemed to be the problem.

Ex. of Flash
Turing:

import GUI

procedure button1
end button1

var button : int := GUI.CreateButtonFull (205, 90, 0, "500",
    button1, 0, '^D', true)

    loop
    exit when GUI.ProcessEvent ()
    GUI.Disable (button)
    end loop


But I didn't expect it to flash, because Im looping a Disable, im not enabling it and disabling it quickly.

So my easy fix was to add an If to check if the button had be previously disabled, and if it was to skip that part of the code. [/syntax]
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: