How Drawmenu work's?
|
11-12-2016, 08:36 PM
(This post was last modified: 11-12-2016 08:39 PM by primer.)
Post: #12
|
|||
|
|||
RE: How Drawmenu work's?
(11-12-2016 02:53 PM)compsystems Wrote: To exit the menu, you have to press the [on] key, then "Program interrupted" =(ho.. I see what you mean. but it's not to "exit the menu", it's to exit the WHILE loop, wich is not part of the lib itself. I'm sorry, but it's a misunderstanding of the purpose of LibMenu. The WHILE loop is on the side of the program developer (you), nothing is implemented in LibMenu for that. You have to build your own loop, it's up to you to decide how user can quit (on ESC key press or else ?) I can't do that choice for you : it's your program. There are many way to handle that. For example : Code: local stay:=1; As it is, LibMenu does not stop program execution, then I can't propose a way to "exit the menu" as you asked. Why did I make that choice : to let more freedom to people that use LibMenu, their program are not waiting for user interaction, program continue to run, it can be helpfull for a game for example... (11-12-2016 02:53 PM)compsystems Wrote: There is a problem, when the menu is on the terminal view. The menu is not updated It's not a problem of the lib, but a problem of the program that use it. Your program perform a wait() just after a print() : you are displaying the terminal and stop program execution, what did you expect ? I provided you in that lib a method to refresh your menu : LibMenu.draw(). Feel feel to place a LibMenu.draw() just before your wait(). Every time you clean the screen, it's up to you to redraw the menu. primer |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)