Class: HotCocoa::SegmentedControlSegment

Inherits:
Object
  • Object
show all
Defined in:
lib/hotcocoa/mappings/appkit/segmented_control.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(control, number) ⇒ SegmentedControlSegment

Returns a new instance of SegmentedControlSegment.



7
8
9
10
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 7

def initialize control, number
  @number = number
  @control = control
end

Instance Attribute Details

#controlObject (readonly)

Returns the value of attribute control.



5
6
7
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 5

def control
  @control
end

#numberObject (readonly)

Returns the value of attribute number.



4
5
6
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 4

def number
  @number
end

Instance Method Details

#enabled=(value) ⇒ Object



56
57
58
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 56

def enabled= value
  control.setEnabled value, forSegment: number
end

#enabled?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 52

def enabled?
  control.isEnabledForSegment number
end

#imageObject



28
29
30
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 28

def image
  control.imageForSegment number
end

#image=(image) ⇒ Object



32
33
34
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 32

def image= image
  control.setImage image, forSegment: number
end

#labelObject



20
21
22
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 20

def label
  control.labelForSegment number
end

#label=(label) ⇒ Object



24
25
26
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 24

def label= label
  control.setLabel label, forSegment: number
end


36
37
38
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 36

def menu
  control.menuForSegment number
end


40
41
42
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 40

def menu= menu
  control.setMenu menu, forSegment: number
end

#selected=(value) ⇒ Object



48
49
50
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 48

def selected= value
  control.setSelected value, forSegment: number
end

#selected?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 44

def selected?
  control.isSelectedForSegment number
end

#widthObject



12
13
14
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 12

def width
  control.widthForSegment number
end

#width=(width) ⇒ Object



16
17
18
# File 'lib/hotcocoa/mappings/appkit/segmented_control.rb', line 16

def width= width
  control.setWidth width, forSegment: number
end