Class: Wx::Clipboard

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/classes/clipboard.rb

Class Method Summary collapse

Class Method Details

.openObject

Class method to provide access to the clipboard within a ruby block. Tests that the clipboard could be accessed, and ensures that it is closed when the block is finished.



6
7
8
9
10
11
12
13
14
# File 'lib/wx/classes/clipboard.rb', line 6

def open
  clip = Wx::Clipboard.new
  unless clip.open
    Kernel.raise "Could not open clipboard"
  end
  yield clip
ensure
  clip.close
end