user interface - Refresh ruby stack with Shoes -


This can be a very simple question, but I've been searching for it for a long time and I have no valid answer yet I have not been found ...

I am trying to get a list of names and make a shoe app with ruby ​​to save it in the file. I would like to show that list which has already been introduced and enters the list as a new name, the list displayed, will be updated. In addition, I would like to add the delete button to each element of the list so that the user can remove that name if necessary.

After all this, the only thing I can find is the part in which you add a name and it is saved in a list, but this second stack is replaced with a deleted button By linking with a list of names ... not so fortunate. What this looks like in my code, the function addName and saveFile are not here, but they only do some work with the list. In addition, some global variables and constraint definitions are not shown:

  Shoes.app (title: "My Higgs field!", Width: APPW, height: APP, resizable: false) { Click to add the information {@edit = edit_line @enter = button "@ Click add info" #{@edit.text} "addName (@ edit.text) end} @save_file =" button " Ficero "@save_file .click do saveFile end} Stacking # Show a list with all names $ names.each do | name | <{Code}  

{@line = legs on any input Names Information} "putting line #" {@} line "@delete = button" Apgar "@ Htaankklik to Htaannam names end {end}}

Thanks a lot!

The question of a shoe is so lengthy! It can not be that here in the fully functioning version, I have taken the liberty to reconstruct everything and use my favorite shoes: green

  'green_shoes' Shoes.app is required (title: "my Higgs field!", Width: 200, height: 200, resizable: false) name @ @, = list = [], zero def update @ list.clear () @name.each up Name | @ list.append do flow to link ('del') {del (name); Update}, '', name end and end and name name name name & lt; & Lt; Name @ name = @ names.uniq.sort update end DEAL DL name @ name Delete the end (name) update stack @edit = edit_line (width: 110, height: 23) keypress do | k | Add "Add" to the end button (@ edit.text) Add the end button to "Save File" ("names.txt", "w +") {| File | File.write (@ names.join ("\ n")}} Alert ("names.txt saved") End of End @list = flow do @ names.each do | p | Para P ,: Size = & End of End of 10th End    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -