Class: Fox::FXObject

Inherits:
Object
  • Object
show all
Defined in:
rdoc-sources/FXObject.rb,
lib/fox16/core.rb,
lib/fox16/tkcompat.rb

Overview

FXObject is the base class for all objects in FOX; in order to receive messages from the user interface, your class must derive from FXObject. The FXObject class also provides serialization facilities, with which you can save and restore the object's state. If you've subclassed from FXObject, you can save your subclasses' state by overloading the save() and load() functions and use the stream API to serialize its member data.

Direct Known Subclasses

FXAccelTable, FXApp, FXDataTarget, FXDebugTarget, FXDelegator, FXDict, FXDocument, FXFoldingItem, FXGLObject, FXHeaderItem, FXIconItem, FXIconSource, FXId, FXListItem, FXPseudoMouse, FXPseudoTarget, FXRecentFiles, FXTableItem, FXTreeItem, FXUndoList

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) subclasses



591
592
593
# File 'lib/fox16/core.rb', line 591

def self.subclasses
  ObjectSpace.enum_for(:each_object, class << self; self; end).to_a
end

Instance Method Details

- (Object) bind(str, pr)



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fox16/tkcompat.rb', line 8

def bind(str, pr)
  tokens = str.split('-')
  modifiers = []
  type = nil
  detail = nil
  case type
    when "Button"
    when "ButtonPress"
      connect(SEL_LEFTBUTTONPRESS, pr)
    when "ButtonRelease"
      connect(SEL_LEFTBUTTONRELEASE, pr)
    when "Configure"
      connect(SEL_CONFIGURE, pr)
    when "Deactivate"
    when "Destroy"
      connect(SEL_DESTROY, pr)
    when "Enter"
      connect(SEL_ENTER, pr)
    when "Expose"
      connect(SEL_PAINT, pr)
    when "FocusIn"
      connect(SEL_FOCUSIN, pr)
    when "FocusOut"
      connect(SEL_FOCUSOUT, pr)
    when "Key"
    when "KeyPress"
      connect(SEL_KEYPRESS, pr)
    when "KeyRelease"
      connect(SEL_KEYRELEASE, pr)
    when "Leave"
      connect(SEL_LEAVE, pr)
    when "Motion"
      connect(SEL_MOTION, pr)
    when "Map"
      connect(SEL_MAP, pr)
    when "Unmap"
      connect(SEL_UNMAP, pr)
    when "Activate"
    when "Circulate"
    when "Colormap"
    when "Gravity"
    when "Property"
    when "Reparent"
    when "Visibility"
      raise NotImplementedError
  end
end

- (Object) handle(sender, selector, data)

Handle a message sent from sender, with given selector and message data.



16
# File 'rdoc-sources/FXObject.rb', line 16

def handle(sender, selector, data); end

- (Object) load(stream)

Load object from stream.



26
# File 'rdoc-sources/FXObject.rb', line 26

def load(stream) ; end

- (Object) save(stream)

Save object to stream.



21
# File 'rdoc-sources/FXObject.rb', line 21

def save(stream) ; end