Jump to content

Recommended Posts

Posted

In some of your examples in the docs you have things like this:

While GuiGetMsg ()>0; to wait a click 
if GuiRead () = $nAdd then GuiCtrlSetData ($nList,"text entry "& $n)   
if GuiRead() = $nClear then GuiCtrlSetData ($nList,"")   
Wend

is this the reason for the GuiRead/Last click thing?  I don't think this method should be used as the extra modes I've added to GuiGetMsg make this loop impractical anyway.  I feel that the best general purpose newbie/advanced loop is:

While 1
  $msg = GuiGetMsg()
  if $msg = $GUI_EVENT_CLOSE Then ExitLoop

; Select statement or IF statements
  If $msg = $nAdd Then ...
  If $msg = $nClear Then ...
Wend

With the extra options for GuiGetMsg (returning arrays of info) and also with multi windows you need to check not only if GUI_EVENT_CLOSE was received but also which window sent the message.  (And it's only 2 lines longer which is not a heavy price to pay for consistency :( )

<{POST_SNAPBACK}>

I think my code is like that due to the first gui implementation.

Now is time to switch tothe new GUI. I am waiting the GuiCtrlSetCallBack/GUICtrlSetOnEvent... :ph34r:

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Administrators
Posted

I think my code is like that due to the first gui implementation.

Now is time to switch tothe new GUI. I am waiting the GuiCtrlSetCallBack/GUICtrlSetOnEvent... :ph34r:

Internally I'm going to change the Event to return a variant, then in GuiGetMsg() you can check the return to see if it's number (normal event) or a string. The string will contain the callback function to call. Should be very easy to implement callback then.

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
  • Recently Browsing   0 members

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