Class Tk::Iwidgets::Notebook
In: tk/lib/tkextlib/iwidgets/notebook.rb
Parent: Tk::Itk::Widget

Methods

Included Modules

TkItemConfigMethod

Constants

TkCommandNames = ['::iwidgets::notebook'.freeze].freeze
WidgetClassName = 'Notebook'.freeze

External Aliases

itemcget -> pagecget
itemconfigure -> pageconfigure
itemconfiginfo -> pageconfiginfo
current_itemconfiginfo -> current_pageconfiginfo

Public Instance methods

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 54
  def add(keys={})
    window(tk_call(@path, 'add', *hash_kv(keys)))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 62
  def child_site(idx)
    if (new_idx = self.index(idx)) < 0
      new_idx = tagid(idx)
    end
    window(tk_call(@path, 'childsite', new_idx))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 58
  def child_site_list
    list(tk_call(@path, 'childsite'))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 69
  def delete(idx1, idx2=nil)
    if (new_idx1 = self.index(idx1)) < 0
      new_idx1 = tagid(idx1)
    end
    if idx2
      if (new_idx2 = self.index(idx2)) < 0
        new_idx2 = tagid(idx2)
      end
      tk_call(@path, 'delete', new_idx1, new_idx2)
    else
      tk_call(@path, 'delete', new_idx1)
    end
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 84
  def index(idx)
    number(tk_call(@path, 'index', tagid(idx)))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 88
  def insert(idx, keys={})
    if (new_idx = self.index(idx)) < 0
      new_idx = tagid(idx)
    end
    window(tk_call(@path, 'insert', new_idx, *hash_kv(keys)))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 95
  def next
    tk_call(@path, 'next')
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 100
  def prev
    tk_call(@path, 'prev')
    self
  end
scrollbar(bar=nil)

Alias for yscrollbar

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 113
  def scrollcommand(cmd=Proc.new)
    configure_cmd 'scrollcommand', cmd
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 105
  def select(idx)
    if (new_idx = self.index(idx)) < 0
      new_idx = tagid(idx)
    end
    tk_call(@path, 'select', new_idx)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 35
  def tagid(tagOrId)
    if tagOrId.kind_of?(Tk::Itk::Component)
      tagOrId.name
    else
      #_get_eval_string(tagOrId)

      tagOrId
    end
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 142
  def view(*index)
    if index.size == 0
      window(tk_send_without_enc('view'))
    else
      tk_send_without_enc('view', *index)
      self
    end
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 153
  def view_moveto(*index)
    view('moveto', *index)
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 158
  def view_scroll(*index)
    view('scroll', *index)
  end

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 120
  def xscrollbar(bar=nil)
    if bar
      @scrollbar = bar
      @scrollbar.orient 'horizontal'
      self.scrollcommand {|*arg| @scrollbar.set(*arg)}
      @scrollbar.command {|*arg| self.xview(*arg)}
      Tk.update  # avoid scrollbar trouble

    end
    @scrollbar
  end
xscrollcommand(cmd=Proc.new)

Alias for scrollcommand

xview(*index)

Alias for view

xview_moveto(*index)

Alias for view_moveto

xview_scroll(*index)

Alias for view_scroll

[Source]

# File tk/lib/tkextlib/iwidgets/notebook.rb, line 130
  def yscrollbar(bar=nil)
    if bar
      @scrollbar = bar
      @scrollbar.orient 'vertical'
      self.scrollcommand {|*arg| @scrollbar.set(*arg)}
      @scrollbar.command {|*arg| self.yview(*arg)}
      Tk.update  # avoid scrollbar trouble

    end
    @scrollbar
  end
yscrollcommand(cmd=Proc.new)

Alias for scrollcommand

yview(*index)

Alias for view

yview_moveto(*index)

Alias for view_moveto

yview_scroll(*index)

Alias for view_scroll

[Validate]