一個觀點我想下面的代碼具有可重複隱藏和顯示的同時再次在其字段保留值的第二個觀點:隱藏和取消隱藏在紅色的語言
Red []
secondFstr: ""
secondshownonce: false
secondshowing: false
secondview: does [
secondshownonce: true
if not secondshowing [
secondshowing: true
view [ below
text "second view"
f2: field secondFstr []
b3: button "Hide" [
secondshowing: false
unview ]]]]
view [ below
text "first view"
b1: button "Print f2 text" [
either not secondshownonce
[print "not shown"]
[print f2/text] ]
b2: button "Show 2nd view" [secondview] ]
它的工作原理的所有權利,如果「隱藏'按鈕用於第二個視圖。但如果通過點擊右上角的'x'關閉第二個視圖,則不能再顯示。我怎麼解決這個問題?
有沒有辦法掛接到接近事件? –
關閉文檔不可用:http://www.red-by-example.org/index.html#0on-close。也不是在這個頁面上:http://www.mycode4fun.co.uk/red-beginners-reference-guide或在https://doc.red-lang.org/en/view.html – rnso