Jump to content
Sign in to follow this  
daslick

GUI's Menu Pauses Script

Recommended Posts

daslick

Like I said in the description, the program pauses when I click on the file menu. Not a technical pause, like if I click "pause autoit script", but it lags up.

any ideas?

Share this post


Link to post
Share on other sites
Andreik

Like I said in the description, the program pauses when I click on the file menu. Not a technical pause, like if I click "pause autoit script", but it lags up.

any ideas?

Look, I think that the script already do that(check what happen when you press FILE menu):

$GUI = GUICreate("TEST")
$MENU = GUICtrlCreateMenu("FILE")
$ITEM1 = GUICtrlCreateMenuItem("OPEN",$MENU)
$ITEM2 = GUICtrlCreateMenuItem("SAVE",$MENU)
$ITEM3 = GUICtrlCreateMenuItem("CLOSE",$MENU)
$NUM_TEST = GUICtrlCreateInput("",200,200,50,20)
GUISetState()

$COUNT = 0

While 1
    If GUIGetMsg() = -3 Then Exit
    $COUNT += 1
    GUICtrlSetData($NUM_TEST,$COUNT)
    Sleep(20)
WEnd

When the words fail... music speaks

Share this post


Link to post
Share on other sites
Valuater

Like I said in the description, the program pauses when I click on the file menu. Not a technical pause, like if I click "pause autoit script", but it lags up.

any ideas?

We need to see your code and understand the direction you want to go...

Before we can bring out the crystal ball!!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
daslick

Thanks Andreik, thanks exactly the problem.

My code is around 800 lines, so can we fix the code that he posted? If we find a solution to it then I'll be able to adapt it for my own script.

EDIT: The only difference is that mine is OnEventMode.

#include <GUIConstantsEx.au3>
$GUI = GUICreate("Test")
Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "End")
$MENU = GUICtrlCreateMenu("File")
$ITEM1 = GUICtrlCreateMenuItem("OPEN",$MENU)
$ITEM2 = GUICtrlCreateMenuItem("SAVE",$MENU)
$ITEM3 = GUICtrlCreateMenuItem("CLOSE",$MENU)
$NUM_TEST = GUICtrlCreateInput("",200,200,50,20)
GUISetState()
$COUNT = 0
While 1
    $COUNT += 1
    GUICtrlSetData($NUM_TEST,$COUNT)
    Sleep(20)
WEnd
Func End()
    Exit
EndFunc
Edited by daslick

Share this post


Link to post
Share on other sites
martin

Thanks Andreik, thanks exactly the problem.

My code is around 800 lines, so can we fix the code that he posted? If we find a solution to it then I'll be able to adapt it for my own script.

EDIT: The only difference is that mine is OnEventMode.

#include <GUIConstantsEx.au3>
 $GUI = GUICreate("Test")
 Opt("GUIOnEventMode", 1)
 GUISetOnEvent($GUI_EVENT_CLOSE, "End")
 $MENU = GUICtrlCreateMenu("File")
 $ITEM1 = GUICtrlCreateMenuItem("OPEN",$MENU)
 $ITEM2 = GUICtrlCreateMenuItem("SAVE",$MENU)
 $ITEM3 = GUICtrlCreateMenuItem("CLOSE",$MENU)
 $NUM_TEST = GUICtrlCreateInput("",200,200,50,20)
 GUISetState()
 $COUNT = 0
 While 1
     $COUNT += 1
     GUICtrlSetData($NUM_TEST,$COUNT)
     Sleep(20)
 WEnd
 Func End()
     Exit
 EndFunc
Like this?

#include <GUIConstantsEx.au3>
#include <timers.au3>
$GUI = GUICreate("Test")
Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "End")
$MENU = GUICtrlCreateMenu("File")
$ITEM1 = GUICtrlCreateMenuItem("OPEN",$MENU)
$ITEM2 = GUICtrlCreateMenuItem("SAVE",$MENU)
$ITEM3 = GUICtrlCreateMenuItem("CLOSE",$MENU)
$NUM_TEST = GUICtrlCreateInput("",200,200,50,20)
GUISetState()
$COUNT = 0
_Timer_SetTimer($gui,25,"countup")
While 1
    Sleep(20)
WEnd
Func End()
    Exit
EndFunc


Func CountUp($a,$b,$c,$d)
    $COUNT += 1
    GUICtrlSetData($NUM_TEST,$COUNT)
EndFunc

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
daslick

YES! I tried the exact same thing with AdlibEnable.

Thank you! !!

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.