Class: AGINTk

Inherits:
AG
  • Object
show all
Defined in:
lib/tk/al-tk.rb

Direct Known Subclasses

ATkTileStyle

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_ag_parent = nil, _object = nil) ⇒ AGINTk

Returns a new instance of AGINTk.



857
858
859
860
# File 'lib/tk/al-tk.rb', line 857

def initialize(_ag_parent = nil, _object = nil)
  super(_ag_parent, _object)
  object_inspector_select
end

Instance Attribute Details

#graphic_objObject (readonly)

Returns the value of attribute graphic_obj.



855
856
857
# File 'lib/tk/al-tk.rb', line 855

def graphic_obj
  @graphic_obj
end

Instance Method Details

#new_graphic_rappresentationObject



878
879
880
881
882
883
884
885
886
887
888
889
890
# File 'lib/tk/al-tk.rb', line 878

def new_graphic_rappresentation
  @graphic_obj = TkLabel.new(@ag_parent.obj){
    background	'#fab4b9'
    background	'#fab4b9'
    foreground	'#a30c17'
    text	'obj'
  }
  if (defined? @ag_parent.where_x)&&(defined? @ag_parent.where_y)
    @graphic_obj.place('x'=>@ag_parent.where_x,'y'=>@ag_parent.where_y)
  end
  AGTkObjPlace.new(@graphic_obj)
  @graphic_obj.bind_append("ButtonPress-1", proc{object_inspector_select; @graphic_obj.callback_break })
end

#new_objectObject



862
863
864
865
# File 'lib/tk/al-tk.rb', line 862

def new_object
  super
  new_graphic_rappresentation
end

#object_inspector_selectObject



892
893
894
895
896
897
# File 'lib/tk/al-tk.rb', line 892

def object_inspector_select
  AGTkLManager.deactivate_all
  self.select
  self.activate
  #@object_inspector.select(self, true) if !defined? @object_inspector.active_object or @object_inspector.active_object != self
end

#update(_event, _agobj) ⇒ Object



867
868
869
870
871
872
873
874
875
876
# File 'lib/tk/al-tk.rb', line 867

def update(_event, _agobj)
  case _event
  when 'SELECT'
    if _agobj == self
      @graphic_obj.configure('relief'=>	'ridge')
    else
      @graphic_obj.configure('relief'=>	'flat')
    end
  end
end