Jump to content

What is the limitation of 'GuiSetControl'?


Recommended Posts

Check this ugly script

global $x=0

GuiCreate ("",730,450)
while 1
myfunc ()
wend


Func myfunc ()
    mygui ()
    $x=$x+1
    sleep (500)      
EndFunc
;-----------------------------------------------------------------------------------------

;-----------------------------------------------------------------------------------------
Func mygui ()
    GuiSetControl ("label", "Current iteration is " & $x, 10,30,700,20)
    GuiSetControl ("label", "abcd", 10,60,700,20)
    GuiSetControl ("label", "abcd", 10,70,700,20)
    GuiSetControl ("label", "abcd", 10,80,700,20)
    GuiSetControl ("label", "abcd", 10,90,700,20)
    GuiSetControl ("label", "abcd", 10,100,700,20)
    GuiSetControl ("label", "abcd", 10,110,700,20)
    GuiSetControl ("label", "abcd", 10,120,700,20)
    GuiSetControl ("label", "abcd", 10,130,700,20)
    GuiSetControl ("label", "abcd", 10,140,700,20)
    GuiSetControl ("label", "abcd", 10,150,700,20)
    GuiSetControl ("label", "abcd", 10,160,700,20)
    GuiSetControl ("label", "abcd", 10,170,700,20)
    GuiSetControl ("label", "abcd", 10,180,700,20)
    GuiSetControl ("label", "abcd", 10,190,700,20)
    GuiSetControl ("label", "abcd", 10,200,700,20)
    GuiSetControl ("label", "abcd", 10,210,700,20)
    GuiSetControl ("label", "abcd", 10,220,700,20)
    GuiSetControl ("label", "abcd", 10,230,700,20)
    GuiSetControl ("label", "abcd", 10,240,700,20)
    GuiSetControl ("label", "abcd", 10,250,700,20)
    GuiSetControl ("label", "abcd", 10,260,700,20)
    GuiSetControl ("label", "abcd", 10,270,700,20)
    GuiSetControl ("label", "abcd", 10,280,700,20)
    GuiSetControl ("label", "abcd", 10,290,700,20)
    GuiSetControl ("label", "abcd", 10,300,700,20)
    GuiSetControl ("label", "abcd", 10,310,700,20)
    GuiSetControl ("label", "abcd", 10,320,700,20)
  
    GuiShow ()
EndFunc

Currently, the GUI stops refreshing at iteration #18.

What is the exact limitation? :ph34r:

10x

Link to comment
Share on other sites

You have a serious error in your logic going on there. You are creating a new control every time. You need to store the control references, then use GuiWrite() to change what the controls display.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...