Jump to content
Sign in to follow this  
DarkNecromancer

GUI slow : \

Recommended Posts

DarkNecromancer

I dont know i'm creating a GUI and when i run it, it takes like 4-5 seconds to exicute the buttons command... I dont understand i even place in some code that i know worked before. I was wondering if you guys had any ideas. heres the code, though i dont think anythings wrong with it.

GUICreate ( "Title" , 600, 330)         ; Create the GUI
GUISetBkColor ( 0x000000 )      ; Set the background to black

;-------------------------------------------------------------
;| Buttons                                                   |
;-------------------------------------------------------------
$extract = GUICtrlCreateButton ( "Extract All Images", 430,  10)
$close   = GUICtrlCreateButton ( "Close",              430, 265)
$hidden  = GUICtrlCreateButton ( "Hidden Mode",        100, 100)

;-------------------------------------------------------------
;| Images                                                    |
;-------------------------------------------------------------
$image = GUICtrlCreatePic ( "imageerror.jpg", 10, 10, 400, 300 )

GUISetState (@SW_SHOW) 


While 1
   Sleep(100)
   $msg = GUIGetMsg()
  
   If $msg = 0 Then Continueloop
   if $msg = -3 then Exit

    Select

        Case $msg = $extract

            msgbox( 0, "Error", "Doesn't Work Yet")

        Case $msg = $close
            
            exit
        
        Case $msg = $hidden
         
            exit
            
    EndSelect

WEnd
It happens both when its compiled and not compiled

Edited by DarkNecromancer

Share this post


Link to post
Share on other sites
phillip123adams

I dont know i'm creating a GUI and when i run it, it takes like 4-5 seconds to exicute the buttons command... I dont understand i even place in some code that i know worked before. I was wondering if you guys had any ideas. heres the code, though i dont think anythings wrong with it.

GUICreate ( "Title" , 600,

  Sleep(100)

[post="48800"]<{POST_SNAPBACK}>[/post]

Someone had the same problem earlier today. Jon told him to loose the Sleep. I think he built in a delay recently, or something like that. I just tried your script with and without the sleep, and without it the action is much faster.

Phillip

Share this post


Link to post
Share on other sites
MHz

Couple of little changes. Try this. I removed the sleep, not required.

GUICreate ( "Title" , 600, 330)        ; Create the GUI
GUISetBkColor ( 0x000000 )     ; Set the background to black

;-------------------------------------------------------------
;| Buttons                                                   |
;-------------------------------------------------------------
$extract = GUICtrlCreateButton ( "Extract All Images", 430,  10)
$close   = GUICtrlCreateButton ( "Close",              430, 265)
$hidden  = GUICtrlCreateButton ( "Hidden Mode",        100, 100)

;-------------------------------------------------------------
;| Images                                                    |
;-------------------------------------------------------------
$image = GUICtrlCreatePic ( "imageerror.jpg", 10, 10, 400, 300 )

GUISetState (@SW_SHOW) 


While 1
  $msg = GUIGetMsg()

   Select
      
      Case $msg = -3
         
         Exit

      Case $msg = $extract

         msgbox( 0, "Error", "Doesn't Work Yet")

      Case $msg = $close
           
         exit
       
      Case $msg = $hidden
        
         exit
           
   EndSelect

WEnd

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.