Code snippet: drawmenu with catching user action
|
03-04-2014, 03:36 PM
Post: #7
|
|||
|
|||
RE: Code snippet: drawmenu with catching user action
Thanks everyone for finding the mentioned error sources! Here is the reworked version.
Important note for everyone who has used the code before: I changed the return value for the case where no on-screen button was pressed to "0" instead of "-1", because of the following change: Now the code also checks whether the button which was pressed is in the list of labels. If this is not the case the negative of the button ID is returned. Example: DrawMenuSelect({"one", "two"}) If user presses button 4, returns "-4" If user presses button 2, returns "2" If user presses none of the on-screen buttons (e.g. by pressing the screen elsewhere, or typing the keyboard) returns "0" Code:
@Han: You mention in your article that a mouse click actually causes three events. Can you explain this a bit more? If I use wait(-1) I only get one list as return value. Are there cases in which I could get a list of lists with more than 1 event? Or is this just an issue if I loop over WAIT(-1), where I would catch the same user action three times? |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Code snippet: drawmenu with catching user action - Stefan - 02-24-2014, 06:26 PM
RE: Code snippet: drawmenu with catching user action - Han - 03-01-2014, 05:04 AM
RE: Code snippet: drawmenu with catching user action - Stefan - 03-03-2014, 10:08 PM
RE: Code snippet: drawmenu with catching user action - patrice - 03-04-2014, 04:52 AM
RE: Code snippet: drawmenu with catching user action - Tim Wessman - 03-03-2014, 10:37 PM
RE: Code snippet: drawmenu with catching user action - Han - 03-04-2014, 03:43 AM
RE: Code snippet: drawmenu with catching user action - Stefan - 03-04-2014 03:36 PM
RE: Code snippet: drawmenu with catching user action - Han - 03-04-2014, 04:02 PM
|
User(s) browsing this thread: 1 Guest(s)