Jump to content

GUIGetMsg for button control


jftuga
 Share

Recommended Posts

If I use:

for $i=1 to 10
$entry = IniRead( $ini_file, "main", "input" & $i, "")
$g_inp[$i] = GUICtrlCreateInput($entry, $x+30, $y-2, 260 )
$g_btn[$i] = GUICtrlCreateButton("submit", $x+300, $y-6, 100 )
$btn_num.add($g_btn[$i],$i)
$y += 28
next

while 1
$msg = GUIGetMsg()

switch $msg
case $GUI_EVENT_CLOSE
         exitloop
     case $g_btn[1] to $g_btn[10]
         ; do more stuff
         $i = $btn_num.item($msg)
endswitch
wend

... everything works well. The problem I have is that 'do more stuff' case section executes when focus is tabbed from the input to the button. I only want this case section activated when the button is clicked, not simply getting focus. How can I fix this?

Thanks,

-John

Link to comment
Share on other sites

  • Developers

You need to do the inputs first and the buttons next in separate loops because else the input handles are within the button handle range.

Jos :)

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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