Class: Gtk::PasswordExample

Inherits:
Box
  • Object
show all
Defined in:
lib/gtk_paradise/examples/gtk3/014_password_example.rb

Overview

Gtk::PasswordExample

Instance Method Summary collapse

Methods inherited from Box

#add_space, #left_aligned_text, #text

Constructor Details

#initialize(run_already = true) ⇒ PasswordExample

#

initialize

#


18
19
20
21
22
23
24
# File 'lib/gtk_paradise/examples/gtk3/014_password_example.rb', line 18

def initialize(
    run_already = true
  )
  super(:horizontal)
  set_border_width(20)
  run if run_already
end

Instance Method Details

#runObject

#

run

#


29
30
31
32
33
34
# File 'lib/gtk_paradise/examples/gtk3/014_password_example.rb', line 29

def run
  password = ::Gtk::Entry.new
  password.set_visibility(false)
  password.invisible_char = 42 # This is '*' in Unicode.
  pack_start(password, fill: false, expand: false)
end