1#
2#  tkextlib/bwidget/passwddlg.rb
3#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
4#
5
6require 'tk'
7require 'tkextlib/bwidget.rb'
8require 'tkextlib/bwidget/messagedlg'
9
10module Tk
11  module BWidget
12    class PasswdDlg < Tk::BWidget::MessageDlg
13    end
14  end
15end
16
17class Tk::BWidget::PasswdDlg
18  TkCommandNames = ['PasswdDlg'.freeze].freeze
19  WidgetClassName = 'PasswdDlg'.freeze
20  WidgetClassNames[WidgetClassName] ||= self
21
22  def __strval_optkeys
23    super() << 'loginhelptext' << 'loginlabel' << 'logintext' <<
24      'passwdlabel' << 'passwdtext'
25  end
26  private :__strval_optkeys
27
28  def __boolval_optkeys
29    super() << 'passwdeditable' << 'homogeneous'
30  end
31  private :__boolval_optkeys
32
33  def __tkvariable_optkeys
34    super() << 'loginhelpvar' << 'logintextvariable' <<
35      'passwdhelpvar' << 'passwdtextvariable'
36  end
37  private :__tkvariable_optkeys
38
39  def create
40    login, passwd = simplelist(tk_call(self.class::TkCommandNames[0],
41                                       @path, *hash_kv(@keys)))
42    [login, passwd]
43  end
44end
45