Class: TkStringType

Inherits:
TkTy
  • Object
show all
Defined in:
ext/ae-rad/ae-rad-inspector.rb

Direct Known Subclasses

TkProcType

Instance Attribute Summary

Attributes inherited from TkTy

#agobj, #labelhost, #prop

Instance Method Summary collapse

Constructor Details

#initialize(_host, _family, _agobj, _prop, _val = nil) ⇒ TkStringType

Returns a new instance of TkStringType.



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'ext/ae-rad/ae-rad-inspector.rb', line 44

def initialize(_host, _family, _agobj, _prop, _val = nil)
  @agobj = _agobj
  @prop = _prop
  @labelhost = _host
  @family = _family
  @etext = TkVariable.new(_host.cget('text'))
  @etextvalue = @etext.to_s
  @propobj = TkEntry.new(_host, Arcadia.style('edit').update({'textvariable'=>@etext})){
    #relief 'groove'
    #font $arcadia['conf']['inspectors.inspector.value.font']
    place('x'=>0, 'y'=>0,'relheight'=>1, 'relwidth'=>1, 'bordermode'=>'outside')
  }
  @propobj.bind("KeyRelease-F1", proc{do_update})
end

Instance Method Details

#do_updateObject



63
64
65
66
67
68
# File 'ext/ae-rad/ae-rad-inspector.rb', line 63

def do_update
  if @etextvalue != @etext.to_s
    @agobj.update_property(self, @family, @prop['name'],@etext.to_s)
    @etextvalue = @etext.to_s
  end
end

#free(_updatehost = true, _text = nil) ⇒ Object



70
71
72
73
# File 'ext/ae-rad/ae-rad-inspector.rb', line 70

def free(_updatehost = true, _text = nil)
  do_update if (defined? @propobj)&&(@propobj != nil)
  super
end

#setpropvalue(_value) ⇒ Object



59
60
61
# File 'ext/ae-rad/ae-rad-inspector.rb', line 59

def setpropvalue(_value)
  @etext = _value
end