Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/rdialog.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# vim:ts=4:sw=4:
# = rdialog - A dialog gem for Ruby
#
Expand Down Expand Up @@ -168,7 +167,7 @@ def checklist(text, items, height=0, width=0, listheight=0)
puts command
success = system(command)
puts success
if success
if success && tmp.size > 0
selected_string = tmp.readline
tmp.close!
selected_string.slice!(0)
Expand Down Expand Up @@ -511,11 +510,14 @@ def inputbox(text="Please enter some text", height=0, width=0, init="")
# box has a Yes button and a No button, in which the user can
# switch between by pressing the TAB key.

def yesno(text="Please enter some text", height=0, width=0)
command = option_string() + "--inputbox \"" + text.to_s +
def yesno(text="Please enter some text", height=0, width=0, value=true)
x = self.nocancel
self.nocancel = false
command = option_string() + (value ? "--yesno" : "--defaultno --yesno") + " \"" + text.to_s +
"\" " + height.to_i.to_s + " " + width.to_i.to_s

success = system(command)
self.nocancel = x
return success
end

Expand Down