Class: Zenity::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/zenity/base.rb

Overview

Internal: Base class for all dialog boxes.

Direct Known Subclasses

List, Message

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



10
11
12
# File 'lib/zenity/base.rb', line 10

def initialize
  @exit_status = nil
end

Instance Attribute Details

#exit_statusObject (readonly)

Returns the value of attribute exit_status.



8
9
10
# File 'lib/zenity/base.rb', line 8

def exit_status
  @exit_status
end

#height=(value) ⇒ Object

Sets the attribute height

Parameters:

  • value

    the value to set the attribute height to.



7
8
9
# File 'lib/zenity/base.rb', line 7

def height=(value)
  @height = value
end

#title=(value) ⇒ Object

Sets the attribute title

Parameters:

  • value

    the value to set the attribute title to.



7
8
9
# File 'lib/zenity/base.rb', line 7

def title=(value)
  @title = value
end

#width=(value) ⇒ Object

Sets the attribute width

Parameters:

  • value

    the value to set the attribute width to.



7
8
9
# File 'lib/zenity/base.rb', line 7

def width=(value)
  @width = value
end

Instance Method Details

#cancel?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/zenity/base.rb', line 24

def cancel?
  @exit_status == CANCEL
end

#error?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/zenity/base.rb', line 28

def error?
  @exit_status == ERROR
end

#expired?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/zenity/base.rb', line 32

def expired?
  @exit_status == EXPIRED
end

#ok?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/zenity/base.rb', line 20

def ok?
  @exit_status == OK
end

#proceedObject



14
15
16
17
18
# File 'lib/zenity/base.rb', line 14

def proceed
  ret = %x[ #{get_command} ]
  @exit_status = $?.exitstatus
  ret.delete("\n")
end