Class: Kelp::ProgressDialog

Inherits:
Gtk::Dialog
  • Object
show all
Defined in:
lib/sh_util.rb

Instance Method Summary collapse

Constructor Details

#initialize(title) ⇒ ProgressDialog

Returns a new instance of ProgressDialog.



83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/sh_util.rb', line 83

def initialize(title)
  super(title,
    nil,
    Dialog::MODAL,
    [Stock::CANCEL, Dialog::RESPONSE_NONE])
  @lbl_message = Label.new("Please wait")
  @lbl_message.ellipsize = Pango::Layout::ELLIPSIZE_START
  vbox.pack_start @lbl_message, false, false, 8
  @progress = ProgressBar.new
  vbox.pack_start @progress, false, false, 8
  self.width_request = 300
  vbox.show_all
end

Instance Method Details

#fractionObject



109
110
111
# File 'lib/sh_util.rb', line 109

def fraction
  @progress.fraction
end

#fraction=(frac) ⇒ Object



105
106
107
# File 'lib/sh_util.rb', line 105

def fraction=(frac)
  @progress.fraction = frac
end

#messageObject



101
102
103
# File 'lib/sh_util.rb', line 101

def message
  @lbl_message.text
end

#message=(msg) ⇒ Object



97
98
99
# File 'lib/sh_util.rb', line 97

def message=(msg)
  @lbl_message.text = msg
end

#pulseObject



113
114
115
# File 'lib/sh_util.rb', line 113

def pulse
  @progress.pulse
end