Jump to content

Unresponsive Button


jezzzzy
 Share

Recommended Posts

I am very new to AutoIt. I apologize in advance.

I have searched through the forums, but aparently I am not very good at it.

My problem is my GUI. The buttons are unresponsive, sometimes requiring 3 or 4 clicks before the click is recognized by the GuiGetMsg() loop. I do not have a "sleep" programmed in.

I have read about GUIOnEventMode. Is this a better control system than the loop? It seems that most people are using the Msg loop. I'm just not sure.

Found this in the forum search: http://www.autoitscript.com/forum/index.ph...wtopic=7668&hl=

But I don't have more than one msg loop. So it doesn't seem to help me. Code is attached. The only buttons that work right now are browse and close.

PlotGUI.au3

Link to comment
Share on other sites

Check this:

I'll suggest you, to store the ID returned in variables:

; BROWSE BUTTON

$btnBrowse = GuiCtrlCreateButton("&Browse", 270, 18, 100, 25)

Check your actual code and just do the comparison:

(explanation: GUIGetMsg() is requested once time at time, not twice. And GUIGetMsg() with a parameter zero inside would do the script a bit slow, because is the advanced mode (unnecessary in this case))

GuiSetState()

While 1;GuiGetMsg() <> $GUI_EVENT_CLOSE

$msg = GuiGetMsg()

If $msg = $GUI_EVENT_CLOSE then ExitLoop

Select

Case $msg = $btnBrowse ; browse button

; BROWSE

Link to comment
Share on other sites

Thanks Josbe. That helped very much. I have read most of the help file but didn't find any of these helpful tidbits. Is there another resource written with coding standards so that while I learn this scripting language I can code more efficiently?

Link to comment
Share on other sites

Thanks Josbe. That helped very much. I have read most of the help file but didn't find any of these helpful tidbits. Is there another resource written with coding standards so that while I learn this scripting language I can code more efficiently?

Well, this could be learned from the helpfile, some concepts that you can read:

- GUI reference (you can read both differences, OnEvent and MessageLoop modes)

- OnEvent mode

- MessageLoop mode

Experiment with the examples included, too.

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...