class Interphase::SimpleStatusBar

Provides a simple status bar which can display a single message.

Attributes

text[R]

Public Class Methods

new(**options, &block) click to toggle source

Create a new simple status bar.

Calls superclass method Interphase::Widget::new
# File lib/interphase/widgets/status_bar.rb, line 11
def initialize(**options, &block)
  super(Gtk::Statusbar.new, options, &block)
end

Public Instance Methods

text=(value) click to toggle source

Sets the text displayed in the status bar.

# File lib/interphase/widgets/status_bar.rb, line 16
def text=(value)
  # Value is frozen to prevent modification without updating the text on the
  # widget (i.e. mutation must be through this method)
  @text = value.clone.freeze

  begin
    gtk_instance.pop(1)
  rescue StandardError # rubocop:disable Lint/HandleExceptions
    # It doesn't matter; just means that there was no text previously
  end

  gtk_instance.push(1, text)
end