class TkFloatTitledFrame

Public Class Methods

new(parent=nil, *args) click to toggle source
Calls superclass method TkBaseTitledFrame::new
# File lib/a-tkcommons.rb, line 1951
def initialize(parent=nil, *args)
  super(parent)
  frame.place('height'=>-32)
  borderwidth  2
  relief  'groove'
  @left_label = TkLabel.new(@top, Arcadia.style('titlelabel')){
    anchor 'w'
  }.place('x'=>0, 'y'=>0,'relheight'=>1, 'relwidth'=>1 ,'width'=>-20)
  #.pack('fill'=>'x', 'side'=>'top')
  @resizing_label=TkLabel.new(self, Arcadia.style('label')){
    text '-'
    image Arcadia.image_res(EXPAND_LIGHT_GIF)
  }.pack('side'=> 'right','anchor'=> 's')
  start_moving(@left_label, self)
  start_moving(frame, self)
  start_resizing(@resizing_label, self)
  @grabbed = false
  @event_loop = false
  #    frame.bind_append('KeyPress'){|e|
  #      p e.keysym
  #      case e.keysym
  #        when 'Escape'
  #          p "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW"
  #          hide
  #      end
  #    }
  Arcadia.instance.register_key_binding(self,"KeyPress[Escape]","ActionEvent.new(self, 'action'=>hide_if_visible)")
end

Public Instance Methods

head_buttons() click to toggle source

def show_modal

# not implemented

end

# File lib/a-tkcommons.rb, line 2038
def head_buttons
end
hide() click to toggle source
# File lib/a-tkcommons.rb, line 1992
def hide
  if @event_loop
    Arcadia.detach_listener(self, ArcadiaEvent)
    @event_loop = false
  end
  @manager = TkWinfo.manager(self)
  if @manager == 'place'
    @x_place = TkPlace.info(self)['x']
    @y_place = TkPlace.info(self)['y']
    @width_place = TkPlace.info(self)['width']
    @height_place = TkPlace.info(self)['height']
    self.unplace
  end

  if @grabbed
    self.grab("release")
    @grabbed = false
  end
  self
end
hide_if_visible() click to toggle source
# File lib/a-tkcommons.rb, line 1988
def hide_if_visible
  hide if visible?
end
on_arcadia(_e) click to toggle source
# File lib/a-tkcommons.rb, line 2013
def on_arcadia(_e)
  self.raise
end
on_close=(_proc) click to toggle source
# File lib/a-tkcommons.rb, line 1984
def on_close=(_proc)
  add_fixed_button('X', _proc, TAB_CLOSE_GIF)
end
show() click to toggle source
# File lib/a-tkcommons.rb, line 2017
def show
  if @manager == 'place'
    self.place('x'=>@x_place, 'y'=>@y_place, 'width'=>@width_place, 'height'=>@height_place)
  end
  if @event_loop == false
    Arcadia.attach_listener(self, ArcadiaEvent)
    @event_loop = true
  end
  self.raise
end
show_grabbed() click to toggle source
# File lib/a-tkcommons.rb, line 2028
def show_grabbed
  show
  @grabbed = true
  self.grab("set")
end
title(_text) click to toggle source
# File lib/a-tkcommons.rb, line 1980
def title(_text)
  @left_label.text(_text)
end