Sha256: 8c73753016db3788456ffe8845b0b2025e7c8b39da361ad2f77f928d50ed38b3
Contents?: true
Size: 1.08 KB
Versions: 4
Compression:
Stored size: 1.08 KB
Contents
class Knj::Gtk2::StatusWindow def initialize(opts = {}) @opts = opts @window = Gtk::Window.new("Status") @window.modal = true @window.border_width = 8 @window.set_frame_dimensions(3, 3, 3, 3) @window.signal_connect("destroy") do destroy end if opts["transient_for"] @window.transient_for = @opts["transient_for"] end @label = Gtk::Label.new("Loading...") @pbar = Gtk::ProgressBar.new @vbox = Gtk::VBox.new @vbox.spacing = 4 @vbox.pack_start(@label, false, true) @vbox.pack_start(@pbar, false, true) @window.add(@vbox) @window.show_all end def label=(newlabel) if @label @label.label = newlabel end end def setStatus(perc, newlabel, temp = nil) if !perc perc = 0 end self.percent = perc self.label = newlabel.to_s end def percent=(newperc) if @pbar @pbar.fraction = newperc end end def destroy if @window @window.destroy end @window = nil @vbox = nil @pbar = nil @label = nil @opts = nil end alias closeWindow destroy end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
knjrbfw-0.0.8 | lib/knj/gtk2_statuswindow.rb |
knjrbfw-0.0.7 | lib/knj/gtk2_statuswindow.rb |
knjrbfw-0.0.4 | lib/knj/gtk2_statuswindow.rb |
knjrbfw-0.0.3 | lib/knj/gtk2_statuswindow.rb |