blob: 2c643e56f7b70d925372b73c7841ede068ee1d91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/usr/bin/env ruby
require 'tk'
require 'tkextlib/iwidgets'
mainloop = Thread.new{Tk.mainloop}
TkOption.add('*textBackground', 'white')
pd = Tk::Iwidgets::Promptdialog.new(:modality=>:global, :title=>'Password',
:labeltext=>'Password:', :show=>'*')
pd.hide('Apply')
if TkComm.bool(pd.activate)
puts "Password entered: #{pd.get}"
else
puts "Password prompt cancelled"
end
|