In Files
- tk/lib/multi-tk.rb
- tk/lib/remote-tk.rb
Parent
Namespace
- MODULE MultiTkIp::ThreadGroup
- CLASS MultiTkIp::Command_Queue
Methods
- ::_DEFAULT_MASTER
- ::_IP_TABLE
- ::_TK_TABLE_LIST
- ::__getip
- ::__init_ip_env__
- ::__pseudo_toplevel
- ::__pseudo_toplevel=
- ::__pseudo_toplevel_evaluable=
- ::__pseudo_toplevel_evaluable?
- ::_conv_listelement
- ::_create_console
- ::_eval
- ::_eval_with_enc
- ::_eval_without_enc
- ::_fromUTF8
- ::_get_global_var
- ::_get_global_var2
- ::_get_variable
- ::_get_variable2
- ::_invoke
- ::_invoke_with_enc
- ::_invoke_without_enc
- ::_ip_id_
- ::_make_menu_embeddable
- ::_merge_tklist
- ::_proc_on_current_safelevel
- ::_proc_on_safelevel
- ::_return_value
- ::_set_global_var
- ::_set_global_var2
- ::_set_variable
- ::_set_variable2
- ::_split_tklist
- ::_thread_tkwait
- ::_thread_vwait
- ::_toUTF8
- ::_unset_global_var
- ::_unset_global_var2
- ::_unset_variable
- ::_unset_variable2
- ::abort
- ::add_tk_procs
- ::alias_delete
- ::alias_info
- ::alias_target
- ::aliases
- ::alive?
- ::allow_ruby_exit=
- ::allow_ruby_exit?
- ::assign_receiver_and_watchdog
- ::background_call
- ::background_eval
- ::background_eval_proc
- ::background_eval_str
- ::background_eval_string
- ::bg_call
- ::bg_eval
- ::bg_eval_proc
- ::bg_eval_str
- ::bg_eval_string
- ::bgerror
- ::call
- ::cb_entry_class
- ::cb_eval
- ::create_table
- ::def_alias
- ::default_encoding
- ::default_encoding=
- ::default_master?
- ::delete
- ::delete_cmd
- ::delete_slaves
- ::deleted?
- ::do_one_event
- ::encoding
- ::encoding=
- ::encoding_convert_from
- ::encoding_convert_to
- ::encoding_convertfrom
- ::encoding_convertto
- ::encoding_name
- ::encoding_obj
- ::encoding_table
- ::eval
- ::eval_proc
- ::eval_str
- ::eval_string
- ::exist?
- ::exit
- ::exit!
- ::expose_cmd
- ::force_default_encoding=
- ::force_default_encoding?
- ::get_cb_entry
- ::get_eventloop_tick
- ::get_eventloop_weight
- ::get_limit
- ::get_no_event_wait
- ::has_mainwindow?
- ::hidden_cmds
- ::hide_cmd
- ::inherited
- ::init_ip_env
- ::init_ip_internal
- ::invalid_namespace?
- ::invoke_hidden
- ::invoke_hidden_on_global
- ::invoke_hidden_on_namespace
- ::ip_name
- ::mainloop
- ::mainloop_abort_on_exception
- ::mainloop_abort_on_exception=
- ::mainloop_watchdog
- ::make_safe
- ::manipulable?
- ::mark_trusted
- ::master?
- ::method_missing
- ::mutex
- ::new
- ::new
- ::new_master
- ::new_safeTk
- ::new_safe_slave
- ::new_slave
- ::new_trusted_slave
- ::path
- ::recursion_limit
- ::remove_tk_procs
- ::restart
- ::safe?
- ::safe_base?
- ::safe_level
- ::safe_level=
- ::set_eventloop_tick
- ::set_eventloop_weight
- ::set_limit
- ::set_no_event_wait
- ::set_safe_level
- ::share_stderr
- ::share_stdin
- ::share_stdio
- ::share_stdout
- ::slave?
- ::slaves
- ::table
- ::thread_eval_proc
- ::tk_cmd_tbl
- ::tk_object_table
- ::tk_windows
- ::to_eval
- ::transfer_stderr
- ::transfer_stdin
- ::transfer_stdio
- ::transfer_stdout
- #__create_safe_slave_obj
- #__create_trusted_slave_obj
- #__eval
- #__invoke
- #__pseudo_toplevel
- #__pseudo_toplevel=
- #__pseudo_toplevel_evaluable=
- #__pseudo_toplevel_evaluable?
- #_add_new_tables
- #_add_tk_procs
- #_conv_listelement
- #_create_slave_object
- #_default_delete_hook
- #_destroy_slaves_of_slaveIP
- #_eval
- #_eval_with_enc
- #_eval_without_enc
- #_fromUTF8
- #_get_global_var
- #_get_global_var2
- #_get_variable
- #_get_variable2
- #_init_ip_env
- #_init_ip_internal
- #_invoke
- #_invoke_with_enc
- #_invoke_without_enc
- #_ip_id_
- #_is_master_of?
- #_make_menu_embeddable
- #_merge_tklist
- #_proc_on_current_safelevel
- #_proc_on_safelevel
- #_receiver_mainloop
- #_remove_tk_procs
- #_return_value
- #_set_global_var
- #_set_global_var2
- #_set_variable
- #_set_variable2
- #_split_tklist
- #_thread_tkwait
- #_thread_vwait
- #_tk_cmd_tbl
- #_tk_table_list
- #_tk_windows
- #_toUTF8
- #_unset_global_var
- #_unset_global_var2
- #_unset_variable
- #_unset_variable2
- #abort
- #alias_delete
- #alias_info
- #alias_target
- #aliases
- #alive?
- #allow_ruby_exit=
- #allow_ruby_exit?
- #background_call
- #background_eval
- #background_eval_proc
- #background_eval_str
- #background_eval_string
- #bg_call
- #bg_eval
- #bg_eval_proc
- #bg_eval_str
- #bg_eval_string
- #call
- #cb_error
- #cb_eval
- #def_alias
- #default_encoding
- #default_encoding=
- #delete
- #delete_cmd
- #delete_slaves
- #deleted?
- #encoding
- #encoding=
- #encoding_convert_from
- #encoding_convert_to
- #encoding_convertfrom
- #encoding_convertto
- #encoding_name
- #encoding_obj
- #encoding_table
- #eval
- #eval_callback
- #eval_proc
- #eval_str
- #eval_string
- #exist?
- #exit
- #exit!
- #expose_cmd
- #force_default_encoding=
- #force_default_encoding?
- #get_bgerror_handler
- #get_limit
- #has_mainwindow?
- #hidden_cmds
- #hide_cmd
- #inspect
- #invalid_namespace?
- #invoke_hidden
- #invoke_hidden_on_global
- #invoke_hidden_on_namespace
- #ip_name
- #mainloop
- #make_safe
- #manipulable?
- #mark_trusted
- #master?
- #mutex
- #path
- #recursion_limit
- #restart
- #running_mainloop?
- #safe?
- #safe_base?
- #safe_level
- #safe_level=
- #safeip_add_to_access_path
- #safeip_configinfo
- #safeip_configure
- #safeip_delete
- #safeip_find_in_access_path
- #safeip_set_log_cmd
- #set_bgerror_handler
- #set_cb_error
- #set_limit
- #set_safe_level
- #share_stderr
- #share_stdin
- #share_stdio
- #share_stdout
- #slave?
- #slaves
- #thread_eval_proc
- #to_eval
- #transfer_stderr
- #transfer_stdin
- #transfer_stdio
- #transfer_stdout
- #wait_on_mainloop=
- #wait_on_mainloop?
Class/Module Index
- Arc
- Bitmap
- BitmapImage
- Checkbutton
- CloneMenu
- Font
- Grid
- INTERP
- Labelframe
- Line
- MenuButton
- MultiTkIp
- MultiTkIp::Command_Queue
- MultiTkIp::ThreadGroup
- MultiTkIp_OK
- MultiTkIp_PseudoToplevel_Evaluable
- Object
- Object::TkNamedVirtualEvent
- Object::TkSystemMenu
- Object::Ttk
- OptionMenuButton
- Oval
- Pack
- Panedwindow
- PhotoImage
- Place
- Polygon
- Radiobutton
- Rectangle
- RemoteTkIp
- Selection
- Spinbox
- TclTk
- TclTkCallback
- TclTkCommand
- TclTkImage
- TclTkInterpreter
- TclTkIp
- TclTkLib
- TclTkLib::EventFlag
- TclTkLib::RELEASE_TYPE
- TclTkLib::VarAccessFlag
- TclTkLibCommand
- TclTkObject
- TclTkVariable
- TclTkWidget
- TextItem
- Tk
- Tk::BLT
- Tk::BLT::Barchart
- Tk::BLT::Bitmap
- Tk::BLT::Busy
- Tk::BLT::Busy::Shield
- Tk::BLT::Container
- Tk::BLT::CutBuffer
- Tk::BLT::DnD
- Tk::BLT::DragDrop
- Tk::BLT::DragDrop::DnD_Handle
- Tk::BLT::DragDrop::PackageCommand
- Tk::BLT::DragDrop::PackageCommand::ValidateArgs
- Tk::BLT::DragDrop::SiteCommand
- Tk::BLT::DragDrop::SiteCommand::ValidateArgs
- Tk::BLT::DragDrop::Token
- Tk::BLT::EPS
- Tk::BLT::Graph
- Tk::BLT::GraphCommand
- Tk::BLT::Hiertable
- Tk::BLT::Htext
- Tk::BLT::PlotComponent
- Tk::BLT::PlotComponent::Axis
- Tk::BLT::PlotComponent::Bar
- Tk::BLT::PlotComponent::BitmapMarker
- Tk::BLT::PlotComponent::Crosshairs
- Tk::BLT::PlotComponent::Element
- Tk::BLT::PlotComponent::GridLine
- Tk::BLT::PlotComponent::ImageMarker
- Tk::BLT::PlotComponent::Legend
- Tk::BLT::PlotComponent::Line
- Tk::BLT::PlotComponent::LineMarker
- Tk::BLT::PlotComponent::Marker
- Tk::BLT::PlotComponent::OptKeys
- Tk::BLT::PlotComponent::Pen
- Tk::BLT::PlotComponent::PolygonMarker
- Tk::BLT::PlotComponent::Postscript
- Tk::BLT::PlotComponent::TextMarker
- Tk::BLT::PlotComponent::WindowMarker
- Tk::BLT::Printer
- Tk::BLT::Spline
- Tk::BLT::Stripchart
- Tk::BLT::Table
- Tk::BLT::Table::TableContainer
- Tk::BLT::Tabnotebook
- Tk::BLT::Tabnotebook::Tab
- Tk::BLT::Tabset
- Tk::BLT::Tabset::NamedTab
- Tk::BLT::Tabset::Tab
- Tk::BLT::Ted
- Tk::BLT::Tile
- Tk::BLT::Tile::Button
- Tk::BLT::Tile::CheckButton
- Tk::BLT::Tile::Checkbutton
- Tk::BLT::Tile::Frame
- Tk::BLT::Tile::Label
- Tk::BLT::Tile::RadioButton
- Tk::BLT::Tile::Radiobutton
- Tk::BLT::Tile::Scrollbar
- Tk::BLT::Tile::Toplevel
- Tk::BLT::Tree
- Tk::BLT::Tree::Node
- Tk::BLT::Tree::Notify
- Tk::BLT::Tree::Tag
- Tk::BLT::Tree::Trace
- Tk::BLT::Treeview
- Tk::BLT::Treeview::ConfigMethod
- Tk::BLT::Treeview::FindExecFlagValue
- Tk::BLT::Treeview::FindExecFlagValue::ValidateArgs
- Tk::BLT::Treeview::Node
- Tk::BLT::Treeview::OpenCloseCommand
- Tk::BLT::Treeview::OpenCloseCommand::ValidateArgs
- Tk::BLT::Treeview::Tag
- Tk::BLT::Treeview::TagOrID_Methods
- Tk::BLT::Vector
- Tk::BLT::VectorAccess
- Tk::BLT::Watch
- Tk::BLT::WinOp
- Tk::BLT::Winop
- Tk::BWidget
- Tk::BWidget::ArrowButton
- Tk::BWidget::Bitmap
- Tk::BWidget::Button
- Tk::BWidget::ButtonBox
- Tk::BWidget::ComboBox
- Tk::BWidget::Dialog
- Tk::BWidget::DragSite
- Tk::BWidget::DropSite
- Tk::BWidget::DynamicHelp
- Tk::BWidget::Entry
- Tk::BWidget::Label
- Tk::BWidget::LabelEntry
- Tk::BWidget::LabelFrame
- Tk::BWidget::ListBox
- Tk::BWidget::ListBox::Event_for_Items
- Tk::BWidget::ListBox::Item
- Tk::BWidget::MainFrame
- Tk::BWidget::MessageDlg
- Tk::BWidget::NoteBook
- Tk::BWidget::NoteBook::Event_for_Tabs
- Tk::BWidget::PagesManager
- Tk::BWidget::PanedWindow
- Tk::BWidget::PanelFrame
- Tk::BWidget::PasswdDlg
- Tk::BWidget::ProgressBar
- Tk::BWidget::ProgressDlg
- Tk::BWidget::ScrollView
- Tk::BWidget::ScrollableFrame
- Tk::BWidget::ScrolledWindow
- Tk::BWidget::SelectColor
- Tk::BWidget::SelectColor::Dialog
- Tk::BWidget::SelectColor::MenuButton
- Tk::BWidget::SelectColor::Menubutton
- Tk::BWidget::SelectFont
- Tk::BWidget::SelectFont::Dialog
- Tk::BWidget::SelectFont::Toolbar
- Tk::BWidget::Separator
- Tk::BWidget::SpinBox
- Tk::BWidget::StatusBar
- Tk::BWidget::TitleFrame
- Tk::BWidget::Tree
- Tk::BWidget::Tree::Event_for_Items
- Tk::BWidget::Tree::Node
- Tk::BWidget::Widget
- Tk::BinaryString
- Tk::Busy
- Tk::Button
- Tk::Canvas
- Tk::CheckButton
- Tk::Clock
- Tk::EncodedString
- Tk::Entry
- Tk::Frame
- Tk::HTML_Widget
- Tk::HTML_Widget::ClippingWindow
- Tk::ICONS
- Tk::Img
- Tk::Img::BMP
- Tk::Img::DTED
- Tk::Img::GIF
- Tk::Img::ICO
- Tk::Img::JPEG
- Tk::Img::PCX
- Tk::Img::PIXMAP
- Tk::Img::PNG
- Tk::Img::PPM
- Tk::Img::PS
- Tk::Img::Raw
- Tk::Img::SGI
- Tk::Img::SUN
- Tk::Img::TGA
- Tk::Img::TIFF
- Tk::Img::WINDOW
- Tk::Img::XBM
- Tk::Img::XPM
- Tk::Itcl
- Tk::Itcl::ItclObject
- Tk::ItemValidateConfigure
- Tk::Itk
- Tk::Itk::Archetype
- Tk::Itk::Component
- Tk::Itk::Toplevel
- Tk::Itk::Widget
- Tk::Iwidgets
- Tk::Iwidgets::Buttonbox
- Tk::Iwidgets::Calendar
- Tk::Iwidgets::Calendar::CalendarCommand
- Tk::Iwidgets::Calendar::CalendarCommand::ValidateArgs
- Tk::Iwidgets::Canvasprintbox
- Tk::Iwidgets::Canvasprintdialog
- Tk::Iwidgets::Checkbox
- Tk::Iwidgets::Combobox
- Tk::Iwidgets::Dateentry
- Tk::Iwidgets::Datefield
- Tk::Iwidgets::Dialog
- Tk::Iwidgets::Dialogshell
- Tk::Iwidgets::Disjointlistbox
- Tk::Iwidgets::Entryfield
- Tk::Iwidgets::Entryfield::EntryfieldValidate
- Tk::Iwidgets::Entryfield::EntryfieldValidate::ValidateArgs
- Tk::Iwidgets::Extbutton
- Tk::Iwidgets::Extfileselectionbox
- Tk::Iwidgets::Extfileselectiondialog
- Tk::Iwidgets::Feedback
- Tk::Iwidgets::Fileselectionbox
- Tk::Iwidgets::Fileselectiondialog
- Tk::Iwidgets::Finddialog
- Tk::Iwidgets::Hierarchy
- Tk::Iwidgets::Hierarchy::IconCommand
- Tk::Iwidgets::Hierarchy::IconCommand::ValidateArgs
- Tk::Iwidgets::Hierarchy::IndicatorCommand
- Tk::Iwidgets::Hierarchy::IndicatorCommand::ValidateArgs
- Tk::Iwidgets::Hierarchy::QueryCommand
- Tk::Iwidgets::Hierarchy::QueryCommand::ValidateArgs
- Tk::Iwidgets::Hyperhelp
- Tk::Iwidgets::Labeledframe
- Tk::Iwidgets::Labeledwidget
- Tk::Iwidgets::Mainwindow
- Tk::Iwidgets::Menubar
- Tk::Iwidgets::Messagebox
- Tk::Iwidgets::Messagedialog
- Tk::Iwidgets::Notebook
- Tk::Iwidgets::Optionmenu
- Tk::Iwidgets::Panedwindow
- Tk::Iwidgets::Promptdialog
- Tk::Iwidgets::Pushbutton
- Tk::Iwidgets::Radiobox
- Tk::Iwidgets::Scopedobject
- Tk::Iwidgets::Scrolledcanvas
- Tk::Iwidgets::Scrolledframe
- Tk::Iwidgets::Scrolledhtml
- Tk::Iwidgets::Scrolledlistbox
- Tk::Iwidgets::Scrolledtext
- Tk::Iwidgets::Scrolledwidget
- Tk::Iwidgets::Selectionbox
- Tk::Iwidgets::Selectiondialog
- Tk::Iwidgets::Shell
- Tk::Iwidgets::Spindate
- Tk::Iwidgets::Spinint
- Tk::Iwidgets::Spinner
- Tk::Iwidgets::Spinner::EntryfieldValidate
- Tk::Iwidgets::Spinner::EntryfieldValidate::ValidateArgs
- Tk::Iwidgets::Spintime
- Tk::Iwidgets::Tabnotebook
- Tk::Iwidgets::Tabset
- Tk::Iwidgets::Timeentry
- Tk::Iwidgets::Timefield
- Tk::Iwidgets::Toolbar
- Tk::Iwidgets::Watch
- Tk::Label
- Tk::LabelFrame
- Tk::Listbox
- Tk::Mac
- Tk::Mac::IconBitmap
- Tk::MacResource
- Tk::Menu
- Tk::Menu::TkInternalFunction
- Tk::MenuClone
- Tk::Menubutton
- Tk::Message
- Tk::OptionMenubutton
- Tk::OptionMenubutton::OptionMenu
- Tk::OptionObj
- Tk::PanedWindow
- Tk::RadioButton
- Tk::Root
- Tk::Scale
- Tk::Scrollable
- Tk::Scrollbar
- Tk::Spinbox
- Tk::Spinbox::SpinCommand
- Tk::Spinbox::SpinCommand::ValidateArgs
- Tk::SysMenu_Apple
- Tk::SysMenu_Help
- Tk::SysMenu_System
- Tk::SystemMenu
- Tk::TOPLEVEL_ALIASES
- Tk::TclX
- Tk::TclX::XPG3_MsgCat
- Tk::Tcllib
- Tk::Tcllib::Autoscroll
- Tk::Tcllib::CText
- Tk::Tcllib::ChatWidget
- Tk::Tcllib::Crosshair
- Tk::Tcllib::Cursor
- Tk::Tcllib::DateField
- Tk::Tcllib::Datefield
- Tk::Tcllib::Diagrams
- Tk::Tcllib::GetString_Dialog
- Tk::Tcllib::History
- Tk::Tcllib::ICO
- Tk::Tcllib::IP6_Entry
- Tk::Tcllib::IPEntry
- Tk::Tcllib::IPEntry6
- Tk::Tcllib::IP_Entry
- Tk::Tcllib::IP_Entry6
- Tk::Tcllib::KHIM
- Tk::Tcllib::KHIM::Help
- Tk::Tcllib::Ntext
- Tk::Tcllib::Plotchart
- Tk::Tcllib::Plotchart::Barchart
- Tk::Tcllib::Plotchart::Barchart3D
- Tk::Tcllib::Plotchart::Boxplot
- Tk::Tcllib::Plotchart::ChartMethod
- Tk::Tcllib::Plotchart::Ganttchart
- Tk::Tcllib::Plotchart::Histogram
- Tk::Tcllib::Plotchart::HorizontalBarchart
- Tk::Tcllib::Plotchart::IsometricPlot
- Tk::Tcllib::Plotchart::Isometricplot
- Tk::Tcllib::Plotchart::Piechart
- Tk::Tcllib::Plotchart::Plot3D
- Tk::Tcllib::Plotchart::PlotSeries
- Tk::Tcllib::Plotchart::PolarPlot
- Tk::Tcllib::Plotchart::Polarplot
- Tk::Tcllib::Plotchart::Radialchart
- Tk::Tcllib::Plotchart::RibbonChart3D
- Tk::Tcllib::Plotchart::RightAxis
- Tk::Tcllib::Plotchart::Stripchart
- Tk::Tcllib::Plotchart::TXPlot
- Tk::Tcllib::Plotchart::Timechart
- Tk::Tcllib::Plotchart::XLogYPlot
- Tk::Tcllib::Plotchart::XYPlot
- Tk::Tcllib::Style
- Tk::Tcllib::Swaplist_Dialog
- Tk::Tcllib::TableList
- Tk::Tcllib::TableList_Tile
- Tk::Tcllib::Tablelist
- Tk::Tcllib::TablelistItemConfig
- Tk::Tcllib::Tablelist_Tile
- Tk::Tcllib::Tkpiechart
- Tk::Tcllib::Tkpiechart::BoxLabeler
- Tk::Tcllib::Tkpiechart::ConfigMethod
- Tk::Tcllib::Tkpiechart::Label
- Tk::Tcllib::Tkpiechart::PeripheralLabeler
- Tk::Tcllib::Tkpiechart::Pie
- Tk::Tcllib::Tkpiechart::PieChartObj
- Tk::Tcllib::Tkpiechart::Slice
- Tk::Tcllib::Tooltip
- Tk::Tcllib::Validator
- Tk::Tcllib::Widget
- Tk::Tcllib::Widget::Calendar
- Tk::Tcllib::Widget::Canvas_Sqmap
- Tk::Tcllib::Widget::Canvas_Zoom
- Tk::Tcllib::Widget::DateEntry
- Tk::Tcllib::Widget::Dateentry
- Tk::Tcllib::Widget::Dialog
- Tk::Tcllib::Widget::MenuEntry
- Tk::Tcllib::Widget::Menuentry
- Tk::Tcllib::Widget::PanelFrame
- Tk::Tcllib::Widget::Panelframe
- Tk::Tcllib::Widget::Ruler
- Tk::Tcllib::Widget::ScreenRuler
- Tk::Tcllib::Widget::Screenruler
- Tk::Tcllib::Widget::ScrolledWindow
- Tk::Tcllib::Widget::Scrolledwindow
- Tk::Tcllib::Widget::Statusbar
- Tk::Tcllib::Widget::SuperFrame
- Tk::Tcllib::Widget::Toolbar
- Tk::Tcllib::Widget::ToolbarItem
- Tk::Tcllib::Widget::ToolbarItemConfig
- Tk::Text
- Tk::Text::IndexModMethods
- Tk::Text::IndexString
- Tk::Tile
- Tk::Tile::Button
- Tk::Tile::CheckButton
- Tk::Tile::Checkbutton
- Tk::Tile::Combobox
- Tk::Tile::Dialog
- Tk::Tile::Entry
- Tk::Tile::Font
- Tk::Tile::Frame
- Tk::Tile::KeyNav
- Tk::Tile::Label
- Tk::Tile::LabelFrame
- Tk::Tile::Labelframe
- Tk::Tile::MenuButton
- Tk::Tile::Menubutton
- Tk::Tile::Notebook
- Tk::Tile::ParseStyleLayout
- Tk::Tile::Progress
- Tk::Tile::Progressbar
- Tk::Tile::RadioButton
- Tk::Tile::Radiobutton
- Tk::Tile::Scale
- Tk::Tile::Scrollbar
- Tk::Tile::Separator
- Tk::Tile::SizeGrip
- Tk::Tile::Sizegrip
- Tk::Tile::Spinbox
- Tk::Tile::Square
- Tk::Tile::Style
- Tk::Tile::TButton
- Tk::Tile::TCheckButton
- Tk::Tile::TCheckbutton
- Tk::Tile::TCombobox
- Tk::Tile::TEntry
- Tk::Tile::TFrame
- Tk::Tile::TLabel
- Tk::Tile::TLabelFrame
- Tk::Tile::TLabelframe
- Tk::Tile::TMenuButton
- Tk::Tile::TMenubutton
- Tk::Tile::TNotebook
- Tk::Tile::TPaned
- Tk::Tile::TProgress
- Tk::Tile::TProgressbar
- Tk::Tile::TRadioButton
- Tk::Tile::TRadiobutton
- Tk::Tile::TScale
- Tk::Tile::TScrollbar
- Tk::Tile::TSeparator
- Tk::Tile::TSpinbox
- Tk::Tile::TSpinbox::SpinCommand
- Tk::Tile::TSpinbox::SpinCommand::ValidateArgs
- Tk::Tile::TSquare
- Tk::Tile::TileWidget
- Tk::Tile::Treeview
- Tk::Tile::Treeview::Item
- Tk::Tile::Treeview::Root
- Tk::Tile::Treeview::Tag
- Tk::Tile::TreeviewConfig
- Tk::Tile::XScrollbar
- Tk::Tile::YScrollbar
- Tk::TkDND
- Tk::TkDND::DND
- Tk::TkDND::DND_Subst
- Tk::TkDND::Shape
- Tk::TkSystemMenu
- Tk::TkTable
- Tk::TkTable::BrowseCommand
- Tk::TkTable::BrowseCommand::ValidateArgs
- Tk::TkTable::CellCommand
- Tk::TkTable::CellCommand::ValidateArgs
- Tk::TkTable::CellTag
- Tk::TkTable::ConfigMethod
- Tk::TkTable::NamedCellTag
- Tk::TkTable::SelectionCommand
- Tk::TkTable::SelectionCommand::ValidateArgs
- Tk::TkTable::ValidateCommand
- Tk::TkTable::ValidateCommand::ValidateArgs
- Tk::TkTrans
- Tk::Toplevel
- Tk::TreeCtrl
- Tk::TreeCtrl::BindCallback
- Tk::TreeCtrl::BitmapElement
- Tk::TreeCtrl::BorderElement
- Tk::TreeCtrl::Column
- Tk::TreeCtrl::ConfigMethod
- Tk::TreeCtrl::Element
- Tk::TreeCtrl::ImageElement
- Tk::TreeCtrl::Item
- Tk::TreeCtrl::NotifyEvent
- Tk::TreeCtrl::RectangleElement
- Tk::TreeCtrl::Style
- Tk::TreeCtrl_Widget
- Tk::Trofs
- Tk::Ttk
- Tk::UTF8_String
- Tk::ValidateConfigure
- Tk::Vu
- Tk::Vu::Bargraph
- Tk::Vu::ChartsConfig
- Tk::Vu::Dial
- Tk::Vu::NamedPieSlice
- Tk::Vu::Pie
- Tk::Vu::PieSlice
- Tk::Vu::PieSliceConfigMethod
- Tk::Vu::TkcBarchart
- Tk::Vu::TkcSticker
- Tk::Vu::TkcStripchart
- Tk::WinDDE
- Tk::WinRegistry
- Tk::Winico
- Tk::Winico::Winico_callback
- Tk::Winico::Winico_callback::ValidateArgs
- Tk::Wm
- Tk::Wm_for_General
- Tk::XScrollable
- Tk::XScrollbar
- Tk::X_Scrollable
- Tk::YScrollable
- Tk::YScrollbar
- Tk::Y_Scrollable
- TkAfter
- TkBgError
- TkBindTag
- TkBindTagAll
- TkBitmapImage
- TkCallbackBreak
- TkCallbackContinue
- TkCallbackEntry
- TkCallbackRedo
- TkCallbackRetry
- TkCallbackReturn
- TkCallbackThrow
- TkCanvasItemConfig
- TkClipboard
- TkComm
- TkComposite
- TkConsole
- TkCore
- TkCore::Tk_OBJECT_TABLE
- TkDatabaseClass
- TkDialog
- TkDialog2
- TkDialogObj
- TkEvent
- TkEvent::Event
- TkEvent::Event::Grp
- TkEvent::Event::StateMask
- TkEvent::Event::TypeNum
- TkFont
- TkFont::Chooser
- TkFont::CoreMethods
- TkFont::DescendantFont
- TkFont::Fontchooser
- TkGrid
- TkImage
- TkItemConfigMethod
- TkItemConfigOptkeys
- TkItemFontOptkeys
- TkKernel
- TkKinput
- TkListItemConfig
- TkLocalJumpError
- TkManageFocus
- TkMenuEntryConfig
- TkMenuSpec
- TkMenubar
- TkMsgCat
- TkMsgCatalog
- TkNamedFont
- TkNamespace
- TkNamespace::Ensemble
- TkNamespace::NsCode
- TkNamespace::ScopeArgs
- TkObject
- TkOption
- TkOptionDB
- TkOptionDB::Priority
- TkPack
- TkPackage
- TkPalette
- TkPhotoImage
- TkPixmapImage
- TkPlace
- TkRTTimer
- TkResourceDB
- TkScrollbox
- TkSelection
- TkTextImage
- TkTextMark
- TkTextMarkAnchor
- TkTextMarkCurrent
- TkTextMarkInsert
- TkTextNamedMark
- TkTextNamedTag
- TkTextTag
- TkTextTagConfig
- TkTextTagSel
- TkTextWin
- TkTextWindow
- TkTimer
- TkTreatItemFont
- TkTreatTagFont
- TkUtil
- TkUtil::CallbackSubst
- TkUtil::CallbackSubst::Info
- TkValidateCommand
- TkValidateCommand::ValidateArgs
- TkValidation
- TkValidation::ValidateCmd
- TkValidation::ValidateCmd::Action
- TkVarAccess
- TkVariable
- TkVirtualEvent
- TkVirtualEvent::PreDefVirtEvent
- TkVirtualEvent::TkNamedVirtualEvent
- TkWarning
- TkWarning2
- TkWarningObj
- TkWindow
- TkWinfo
- TkXIM
- TkcArc
- TkcBitmap
- TkcGroup
- TkcImage
- TkcItem
- TkcLine
- TkcNamedTag
- TkcOval
- TkcPolygon
- TkcRectangle
- TkcTag
- TkcTagAccess
- TkcTagAll
- TkcTagCurrent
- TkcTagString
- TkcText
- TkcWindow
- TktImage
- TktMark
- TktMarkAnchor
- TktMarkCurrent
- TktMarkInsert
- TktNamedMark
- TktNamedTag
- TktTag
- TktTagSel
- TktWindow
- Variable
- VirtualEvent
- WindowItem
- Winfo
- unknown
MultiTkIp
Constants
- BASE_DIR
- INTERP_MUTEX
- INTERP_ROOT_CHECK
- INTERP_THREAD
- INTERP_THREAD_STATUS
- RUN_EVENTLOOP_ON_MAIN_THREAD
Ruby 1.9 !!!!!!!!!!!!!!!!!!!!!!!!!!
- WITH_ENCODING
- WITH_RUBY_VM
Public Class Methods
_DEFAULT_MASTER()
# File tk/lib/remote-tk.rb, line 20 def self._DEFAULT_MASTER # work only once if @flag @flag = nil @@DEFAULT_MASTER else nil end end
__getip()
# File tk/lib/multi-tk.rb, line 1527 def self.__getip current = Thread.current if current.kind_of?(@@CALLBACK_SUBTHREAD) return current[:callback_ip] end if TclTkLib.mainloop_thread? != false && current[:callback_ip] return current[:callback_ip] end if current.group == ThreadGroup::Default @@DEFAULT_MASTER else ip = @@IP_TABLE[current.group] unless ip fail SecurityError, "cannot call Tk methods on #{Thread.current.inspect}" end ip end end
__init_ip_env__(table, script)
# File tk/lib/multi-tk.rb, line 957 def self.__init_ip_env__(table, script) ret = [] mtx = (Thread.current[:MultiTk_ip_Mutex] ||= Mutex.new) cond = (Thread.current[:MultiTk_ip_CondVar] ||= ConditionVariable.new) mtx.synchronize{ @init_ip_env_queue.enq([mtx, cond, ret, table, script]) cond.wait(mtx) } if ret[0].kind_of?(Exception) raise ret[0] else ret[0] end end
__pseudo_toplevel()
# File tk/lib/multi-tk.rb, line 846 def self.__pseudo_toplevel Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER && self.__pseudo_toplevel_evaluable? && @pseudo_toplevel[1] end
__pseudo_toplevel=(m)
# File tk/lib/multi-tk.rb, line 852 def self.__pseudo_toplevel=(m) unless (Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER) fail SecurityError, "no permission to manipulate" end # if m.kind_of?(Module) && m.respond_to?(:pseudo_toplevel_evaluable?) if m.respond_to?(:pseudo_toplevel_evaluable?) @pseudo_toplevel[0] = true @pseudo_toplevel[1] = m else fail ArgumentError, 'fail to set pseudo-toplevel' end self end
__pseudo_toplevel_evaluable=(mode)
# File tk/lib/multi-tk.rb, line 876 def self.__pseudo_toplevel_evaluable=(mode) unless (Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER) fail SecurityError, "no permission to manipulate" end @pseudo_toplevel[0] = (mode)? true: false end
__pseudo_toplevel_evaluable?()
# File tk/lib/multi-tk.rb, line 868 def self.__pseudo_toplevel_evaluable? begin @pseudo_toplevel[0] && @pseudo_toplevel[1].pseudo_toplevel_evaluable? rescue Exception false end end
_conv_listelement(arg)
# File tk/lib/multi-tk.rb, line 2676 def _conv_listelement(arg) __getip._conv_listelement(arg) end
_create_console()
# File tk/lib/multi-tk.rb, line 2680 def _create_console __getip._create_console end
_eval_with_enc(str)
# File tk/lib/multi-tk.rb, line 2600 def _eval_with_enc(str) __getip._eval_with_enc(str) end
_eval_without_enc(str)
# File tk/lib/multi-tk.rb, line 2592 def _eval_without_enc(str) __getip._eval_without_enc(str) end
_fromUTF8(str, encoding=nil)
# File tk/lib/multi-tk.rb, line 2612 def _fromUTF8(str, encoding=nil) __getip._fromUTF8(str, encoding) end
_get_global_var(var)
# File tk/lib/multi-tk.rb, line 2647 def _get_global_var(var) __getip._get_global_var(var) end
_get_global_var2(var, idx)
# File tk/lib/multi-tk.rb, line 2650 def _get_global_var2(var, idx) __getip._get_global_var2(var, idx) end
_get_variable(var, flag)
# File tk/lib/multi-tk.rb, line 2628 def _get_variable(var, flag) __getip._get_variable(var, flag) end
_get_variable2(var, idx, flag)
# File tk/lib/multi-tk.rb, line 2631 def _get_variable2(var, idx, flag) __getip._get_variable2(var, idx, flag) end
_invoke_with_enc(*args)
# File tk/lib/multi-tk.rb, line 2604 def _invoke_with_enc(*args) __getip._invoke_with_enc(*args) end
_invoke_without_enc(*args)
# File tk/lib/multi-tk.rb, line 2596 def _invoke_without_enc(*args) __getip._invoke_without_enc(*args) end
_merge_tklist(*args)
# File tk/lib/multi-tk.rb, line 2673 def _merge_tklist(*args) __getip._merge_tklist(*args) end
_proc_on_current_safelevel(cmd=nil, &blk)
# File tk/lib/multi-tk.rb, line 2135 def MultiTkIp._proc_on_current_safelevel(cmd=nil, &blk) MultiTkIp.__getip._proc_on_current_safelevel(cmd, &blk) end
_proc_on_safelevel(cmd=nil, &blk)
# File tk/lib/multi-tk.rb, line 2126 def MultiTkIp._proc_on_safelevel(cmd=nil, &blk) MultiTkIp.__getip._proc_on_safelevel(cmd, &blk) end
_set_global_var(var, value)
# File tk/lib/multi-tk.rb, line 2653 def _set_global_var(var, value) __getip._set_global_var(var, value) end
_set_global_var2(var, idx, value)
# File tk/lib/multi-tk.rb, line 2656 def _set_global_var2(var, idx, value) __getip._set_global_var2(var, idx, value) end
_set_variable(var, value, flag)
# File tk/lib/multi-tk.rb, line 2634 def _set_variable(var, value, flag) __getip._set_variable(var, value, flag) end
_set_variable2(var, idx, value, flag)
# File tk/lib/multi-tk.rb, line 2637 def _set_variable2(var, idx, value, flag) __getip._set_variable2(var, idx, value, flag) end
_split_tklist(str)
# File tk/lib/multi-tk.rb, line 2670 def _split_tklist(str) __getip._split_tklist(str) end
_thread_tkwait(mode, target)
# File tk/lib/multi-tk.rb, line 2620 def _thread_tkwait(mode, target) __getip._thread_tkwait(mode, target) end
_thread_vwait(var)
# File tk/lib/multi-tk.rb, line 2616 def _thread_vwait(var) __getip._thread_vwait(var) end
_toUTF8(str, encoding=nil)
# File tk/lib/multi-tk.rb, line 2608 def _toUTF8(str, encoding=nil) __getip._toUTF8(str, encoding) end
_unset_global_var(var)
# File tk/lib/multi-tk.rb, line 2659 def _unset_global_var(var) __getip._unset_global_var(var) end
_unset_global_var2(var, idx)
# File tk/lib/multi-tk.rb, line 2662 def _unset_global_var2(var, idx) __getip._unset_global_var2(var, idx) end
_unset_variable(var, flag)
# File tk/lib/multi-tk.rb, line 2640 def _unset_variable(var, flag) __getip._unset_variable(var, flag) end
_unset_variable2(var, idx, flag)
# File tk/lib/multi-tk.rb, line 2643 def _unset_variable2(var, idx, flag) __getip._unset_variable2(var, idx, flag) end
add_tk_procs(name, args=nil, body=nil)
# File tk/lib/multi-tk.rb, line 1876 def self.add_tk_procs(name, args=nil, body=nil) if name.kind_of?(Array) # => an array of [name, args, body] name.each{|param| self.add_tk_procs(*param)} else name = name.to_s @@ADD_TK_PROCS << [name, args, body] @@IP_TABLE.each{|tg, ip| ip._add_tk_procs(name, args, body) } end end
alias_delete(slave, cmd_name)
# File tk/lib/multi-tk.rb, line 3191 def self.alias_delete(slave, cmd_name) __getip.alias_delete(slave, cmd_name) self end
alias_info(slave, cmd_name)
# File tk/lib/multi-tk.rb, line 3182 def self.alias_info(slave, cmd_name) __getip.alias_info(slave, cmd_name) end
alias_target(aliascmd, slave = '')
# File tk/lib/multi-tk.rb, line 3422 def self.alias_target(aliascmd, slave = '') __getip.alias_target(aliascmd, slave) end
aliases(slave = '')
# File tk/lib/multi-tk.rb, line 3211 def self.aliases(slave = '') __getip.aliases(slave) end
allow_ruby_exit=(mode)
# File tk/lib/multi-tk.rb, line 2541 def allow_ruby_exit= (mode) __getip.allow_ruby_exit = mode end
allow_ruby_exit?()
# File tk/lib/multi-tk.rb, line 2537 def allow_ruby_exit? __getip.allow_ruby_exit? end
assign_receiver_and_watchdog(target)
# File tk/lib/multi-tk.rb, line 924 def self.assign_receiver_and_watchdog(target) ret = [nil] @assign_thread.raise(@assign_request.new(target, ret)) while ret[0] == nil unless @assign_thread.alive? raise RuntimeError, 'lost the thread to assign a receiver and a watchdog thread' end end if ret[0].kind_of?(Exception) raise ret[0] else ret[0] end end
bg_eval(*args, &blk)
# File tk/lib/multi-tk.rb, line 2462 def bg_eval(*args, &blk) # class ==> interp object __getip.bg_eval(*args, &blk) end
Also aliased as: background_eval
bg_eval_proc(*args, &blk)
# File tk/lib/multi-tk.rb, line 2435 def bg_eval_proc(*args, &blk) # class ==> interp object __getip.bg_eval_proc(*args, &blk) end
bg_eval_string(cmd, *eval_args)
# File tk/lib/multi-tk.rb, line 2450 def bg_eval_string(cmd, *eval_args) # class ==> interp object __getip.bg_eval_string(cmd, *eval_args) end
bgerror(cmd = Proc.new, slave = nil, &b)
# File tk/lib/multi-tk.rb, line 3364 def self.bgerror(cmd = Proc.new, slave = nil, &b) __getip.bgerror(cmd, slave, &b) end
cb_eval(cmd, *args)
# File tk/lib/tk.rb, line 1455 def INTERP.cb_eval(cmd, *args) TkUtil._get_eval_string(TkUtil.eval_cmd(cmd, *args)) end
create_table()
# File tk/lib/multi-tk.rb, line 1819 def self.create_table if __getip.slave? begin raise SecurityError, "slave-IP has no permission creating a new table" rescue SecurityError => e #p e.backtrace # Is called on a Ruby/Tk library? caller_info = e.backtrace[1] if caller_info =~ %r{^#{MultiTkIp::BASE_DIR}/(tk|tkextlib)/[^:]+\.rb:} # Probably, caller is a Ruby/Tk library --> allow creating else raise e end end end id = @@TK_TABLE_LIST.size obj = Object.new @@TK_TABLE_LIST << obj obj.instance_variable_set(:@id, id) obj.instance_variable_set(:@mutex, Mutex.new) obj.instance_eval{ def self.mutex @mutex end def self.method_missing(m, *args) MultiTkIp.tk_object_table(@id).__send__(m, *args) end } obj.freeze @@IP_TABLE.each{|tg, ip| ip._add_new_tables } return obj end
def_alias(slave, new_cmd, org_cmd, *args)
# File tk/lib/multi-tk.rb, line 3202 def self.def_alias(slave, new_cmd, org_cmd, *args) ret = __getip.def_alias(slave, new_cmd, org_cmd, *args) (ret == new_cmd)? self: nil end
default_encoding=(enc)
# File tk/lib/multi-tk.rb, line 3603 def default_encoding=(enc) __getip.default_encoding=(enc) end
default_master?()
# File tk/lib/multi-tk.rb, line 2473 def self.default_master? __getip == @@DEFAULT_MASTER end
delete_cmd(slave, cmd)
# File tk/lib/multi-tk.rb, line 3241 def self.delete_cmd(slave, cmd) __getip.delete_cmd(slave, cmd) self end
delete_slaves(*args)
# File tk/lib/multi-tk.rb, line 3221 def self.delete_slaves(*args) __getip.delete_slaves(*args) self end
do_one_event(flag = TclTkLib::EventFlag::ALL)
# File tk/lib/multi-tk.rb, line 2484 def do_one_event(flag = TclTkLib::EventFlag::ALL) __getip.do_one_event(flag) end
encoding_convertfrom(str, enc=None)
# File tk/lib/multi-tk.rb, line 3621 def encoding_convertfrom(str, enc=None) __getip.encoding_convertfrom(str, enc) end
Also aliased as: encoding_convert_from
encoding_convertto(str, enc=None)
# File tk/lib/multi-tk.rb, line 3626 def encoding_convertto(str, enc=None) __getip.encoding_convertto(str, enc) end
Also aliased as: encoding_convert_to
encoding_name()
# File tk/lib/multi-tk.rb, line 3611 def encoding_name __getip.encoding_name end
Also aliased as: encoding, default_encoding
eval(*args, &blk)
# File tk/lib/multi-tk.rb, line 2458 def eval(*args, &blk) # class ==> interp object __getip.eval(*args, &blk) end
eval_proc(*args, &blk)
class method
# File tk/lib/multi-tk.rb, line 2429 def eval_proc(*args, &blk) # class ==> interp object __getip.eval_proc(*args, &blk) end
Also aliased as: call
eval_string(cmd, *eval_args)
# File tk/lib/multi-tk.rb, line 2444 def eval_string(cmd, *eval_args) # class ==> interp object __getip.eval_string(cmd, *eval_args) end
Also aliased as: eval_str
exist?(slave = '')
# File tk/lib/multi-tk.rb, line 3231 def self.exist?(slave = '') __getip.exist?(slave) end
expose_cmd(slave, cmd, aliasname = nil)
# File tk/lib/multi-tk.rb, line 3255 def self.expose_cmd(slave, cmd, aliasname = nil) __getip.expose_cmd(slave, cmd, aliasname) self end
force_default_encoding=(mode)
# File tk/lib/multi-tk.rb, line 3595 def force_default_encoding=(mode) __getip.force_default_encoding=(mode) end
force_default_encoding?()
# File tk/lib/multi-tk.rb, line 3599 def force_default_encoding? __getip.force_default_encoding? end
get_cb_entry(cmd)
# File tk/lib/multi-tk.rb, line 1910 def self.get_cb_entry(cmd) @@CB_ENTRY_CLASS.new(__getip, cmd).freeze end
get_eventloop_tick()
# File tk/lib/multi-tk.rb, line 2498 def get_eventloop_tick __getip.get_eventloop_tick end
get_eventloop_weight()
# File tk/lib/multi-tk.rb, line 2510 def get_eventloop_weight __getip.get_eventloop_weight end
get_limit(limit_type, slave = '', slot = nil)
# File tk/lib/multi-tk.rb, line 3405 def self.get_limit(limit_type, slave = '', slot = nil) __getip.get_limit(limit_type, slave, slot) end
get_no_event_wait()
# File tk/lib/multi-tk.rb, line 2504 def get_no_event_wait __getip.get_no_event_wait end
has_mainwindow?()
# File tk/lib/multi-tk.rb, line 2553 def has_mainwindow? __getip.has_mainwindow? end
hide_cmd(slave, cmd, aliasname = nil)
# File tk/lib/multi-tk.rb, line 3269 def self.hide_cmd(slave, cmd, aliasname = nil) __getip.hide_cmd(slave, cmd, aliasname) self end
inherited(subclass)
# File tk/lib/multi-tk.rb, line 983 def self.inherited(subclass) # trust if on ThreadGroup::Default or @@DEFAULT_MASTER's ThreadGroup if @@IP_TABLE[Thread.current.group] == @@DEFAULT_MASTER begin class << subclass self.methods.each{|m| name = m.to_s begin unless name == '__id__' || name == '__send__' || name == 'freeze' undef_method(m) end rescue Exception # ignore all exceptions end } end ensure subclass.freeze fail SecurityError, "cannot create subclass of MultiTkIp on a untrusted ThreadGroup" end end end
init_ip_env(script = Proc.new)
# File tk/lib/multi-tk.rb, line 1853 def self.init_ip_env(script = Proc.new) @@INIT_IP_ENV << script if __getip.slave? begin raise SecurityError, "slave-IP has no permission initializing IP env" rescue SecurityError => e #p e.backtrace # Is called on a Ruby/Tk library? caller_info = e.backtrace[1] if caller_info =~ %r{^#{MultiTkIp::BASE_DIR}/(tk|tkextlib)/[^:]+\.rb:} # Probably, caller is a Ruby/Tk library --> allow creating else raise e end end end # @@IP_TABLE.each{|tg, ip| # ip._init_ip_env(script) # } @@DEFAULT_MASTER.__init_ip_env__(@@IP_TABLE, script) end
init_ip_internal()
# File tk/lib/multi-tk.rb, line 1900 def self.init_ip_internal __getip._init_ip_internal(@@INIT_IP_ENV, @@ADD_TK_PROCS) end
invalid_namespace?()
# File tk/lib/multi-tk.rb, line 2557 def invalid_namespace? __getip.invalid_namespace? end
mainloop(check_root = true)
# File tk/lib/multi-tk.rb, line 800 def self.mainloop(check_root = true) begin TclTkLib.set_eventloop_window_mode(true) @interp_thread.value ensure TclTkLib.set_eventloop_window_mode(false) end end
mainloop_abort_on_exception()
# File tk/lib/multi-tk.rb, line 2487 def mainloop_abort_on_exception # __getip.mainloop_abort_on_exception TclTkLib.mainloop_abort_on_exception end
mainloop_abort_on_exception=(mode)
# File tk/lib/multi-tk.rb, line 2491 def mainloop_abort_on_exception=(mode) # __getip.mainloop_abort_on_exception=(mode) TclTkLib.mainloop_abort_on_exception=(mode) end
mainloop_watchdog(check_root = true)
# File tk/lib/multi-tk.rb, line 2481 def mainloop_watchdog(check_root = true) __getip.mainloop_watchdog(check_root) end
mark_trusted(slave = '')
# File tk/lib/multi-tk.rb, line 3346 def self.mark_trusted(slave = '') __getip.mark_trusted(slave) self end
method_missing(m, *args)
# File tk/lib/multi-tk.rb, line 1844 def self.method_missing(m, *args) MultiTkIp.tk_object_table(@id).__send__(m, *args) end
new(ip, cmd)
# File tk/lib/multi-tk.rb, line 188 def initialize(ip, cmd) @ip = ip @safe = safe = $SAFE # @cmd = cmd cmd = MultiTkIp._proc_on_safelevel(&cmd) @cmd = proc{|*args| cmd.call(safe, *args)} self.freeze end
Also aliased as: __new
new(target, ret)
# File tk/lib/multi-tk.rb, line 888 def self.new(target, ret) obj = super() obj.target = target obj.ret = ret obj end
new_master(safe=nil, keys={}, &blk)
# File tk/lib/multi-tk.rb, line 1554 def new_master(safe=nil, keys={}, &blk) if MultiTkIp::WITH_RUBY_VM #### TODO !!!!!! fail RuntimeError, 'sorry, still not support multiple master-interpreters on RubyVM' end if safe.kind_of?(Hash) keys = safe elsif safe.kind_of?(Integer) raise ArgumentError, "unexpected argument(s)" unless keys.kind_of?(Hash) if !keys.key?(:safe) && !keys.key?('safe') keys[:safe] = safe end elsif safe == nil # do nothing else raise ArgumentError, "unexpected argument(s)" end ip = __new(__getip, nil, keys) #ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call) if block_given? if block_given? #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call)} #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; yield}.call)} ip._proc_on_safelevel(&blk).call(ip.safe_level) end ip end
Also aliased as: new
new_safe_slave(safe=1, keys={}, &blk)
# File tk/lib/multi-tk.rb, line 1611 def new_safe_slave(safe=1, keys={}, &blk) if safe.kind_of?(Hash) keys = safe elsif safe.kind_of?(Integer) raise ArgumentError, "unexpected argument(s)" unless keys.kind_of?(Hash) if !keys.key?(:safe) && !keys.key?('safe') keys[:safe] = safe end else raise ArgumentError, "unexpected argument(s)" end ip = __new(__getip, true, keys) # ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call) if block_given? if block_given? #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call)} #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; yield}.call)} ip._proc_on_safelevel(&blk).call(ip.safe_level) end ip end
Also aliased as: new_safeTk
new_slave(safe=nil, keys={}, &blk)
# File tk/lib/multi-tk.rb, line 1586 def new_slave(safe=nil, keys={}, &blk) if safe.kind_of?(Hash) keys = safe elsif safe.kind_of?(Integer) raise ArgumentError, "unexpected argument(s)" unless keys.kind_of?(Hash) if !keys.key?(:safe) && !keys.key?('safe') keys[:safe] = safe end elsif safe == nil # do nothing else raise ArgumentError, "unexpected argument(s)" end ip = __new(__getip, false, keys) # ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call) if block_given? if block_given? #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call)} #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; yield}.call)} ip._proc_on_safelevel(&blk).call(ip.safe_level) end ip end
Also aliased as: new_trusted_slave
recursion_limit(slave = '', limit = None)
# File tk/lib/multi-tk.rb, line 3414 def self.recursion_limit(slave = '', limit = None) __getip.recursion_limit(slave) end
remove_tk_procs(*names)
# File tk/lib/multi-tk.rb, line 1888 def self.remove_tk_procs(*names) names.each{|name| name = name.to_s @@ADD_TK_PROCS.delete_if{|elem| elem.kind_of?(Array) && elem[0].to_s == name } } @@IP_TABLE.each{|tg, ip| ip._remove_tk_procs(*names) } end
restart(app_name = nil, keys = {})
# File tk/lib/multi-tk.rb, line 2573 def restart(app_name = nil, keys = {}) init_ip_internal __getip._invoke('set', 'argv0', app_name) if app_name if keys.kind_of?(Hash) __getip._invoke('set', 'argv', _keys2opts(keys)) end __getip.restart end
safe_base?()
# File tk/lib/multi-tk.rb, line 2529 def safe_base? begin __getip.safe_base? rescue false end end
safe_level=(safe)
# File tk/lib/multi-tk.rb, line 330 def self.safe_level=(safe) self.set_safe_level(safe) end
set_eventloop_tick(tick)
# File tk/lib/multi-tk.rb, line 2495 def set_eventloop_tick(tick) __getip.set_eventloop_tick(tick) end
set_eventloop_weight(loop_max, no_event_tick)
# File tk/lib/multi-tk.rb, line 2507 def set_eventloop_weight(loop_max, no_event_tick) __getip.set_eventloop_weight(loop_max, no_event_tick) end
set_limit(limit_type, slave = '', opts = {})
# File tk/lib/multi-tk.rb, line 3380 def self.set_limit(limit_type, slave = '', opts = {}) __getip.set_limit(limit_type, slave, opts) end
set_no_event_wait(tick)
# File tk/lib/multi-tk.rb, line 2501 def set_no_event_wait(tick) __getip.set_no_event_wait(tick) end
set_safe_level(safe)
# File tk/lib/multi-tk.rb, line 327 def self.set_safe_level(safe) __getip.set_safe_level(safe) end
slaves(all = false)
# File tk/lib/multi-tk.rb, line 1724 def self.slaves(all = false) __getip.slaves(all) end
tk_object_table(id)
# File tk/lib/multi-tk.rb, line 1816 def self.tk_object_table(id) __getip._tk_table_list[id] end
transfer_stderr(dist, src = '')
# File tk/lib/multi-tk.rb, line 3481 def self.transfer_stderr(dist, src = '') __getip.transfer_stderr(dist, src) self end
transfer_stdin(dist, src = '')
# File tk/lib/multi-tk.rb, line 3461 def self.transfer_stdin(dist, src = '') __getip.transfer_stdin(dist, src) self end
Public Instance Methods
__create_safe_slave_obj(safe_opts, app_name, tk_opts)
# File tk/lib/multi-tk.rb, line 1190 def __create_safe_slave_obj(safe_opts, app_name, tk_opts) raise SecurityError, "no permission to manipulate" unless self.manipulable? # safe interpreter ip_name = _create_slave_ip_name slave_ip = @interp.create_slave(ip_name, true) slave_ip.instance_eval{ @force_default_encoding ||= TkUtil.untrust([false]) @encoding ||= TkUtil.untrust([nil]) def @encoding.to_s; self.join(nil); end } @slave_ip_tbl[ip_name] = slave_ip def slave_ip.safe_base? true end @interp._eval("::safe::interpInit #{ip_name}") slave_ip._invoke('set', 'argv0', app_name) if app_name.kind_of?(String) if tk_opts tk_opts = __check_safetk_optkeys(tk_opts) if tk_opts.key?('use') @slave_ip_top[ip_name] = '' else tk_opts, top_path = __create_safetk_frame(slave_ip, ip_name, app_name, tk_opts) @slave_ip_top[ip_name] = top_path end @interp._eval("::safe::loadTk #{ip_name} #{_keys2opts(tk_opts)}") @interp._invoke('__replace_slave_tk_commands__', ip_name) else @slave_ip_top[ip_name] = nil end if safe_opts.key?('deleteHook') || safe_opts.key?(:deleteHook) @interp._eval("::safe::interpConfigure #{ip_name} " + _keys2opts(safe_opts)) else @interp._eval("::safe::interpConfigure #{ip_name} " + _keys2opts(safe_opts) + '-deleteHook {' + TkComm._get_eval_string(proc{|slave| self._default_delete_hook(slave) }) + '}') end [slave_ip, ip_name] end
__create_trusted_slave_obj(name, keys)
# File tk/lib/multi-tk.rb, line 1239 def __create_trusted_slave_obj(name, keys) raise SecurityError, "no permission to manipulate" unless self.manipulable? ip_name = _create_slave_ip_name slave_ip = @interp.create_slave(ip_name, false) slave_ip.instance_eval{ @force_default_encoding ||= TkUtil.untrust([false]) @encoding ||= TkUtil.untrust([nil]) def @encoding.to_s; self.join(nil); end } slave_ip._invoke('set', 'argv0', name) if name.kind_of?(String) slave_ip._invoke('set', 'argv', _keys2opts(keys)) @interp._invoke('load', '', 'Tk', ip_name) @interp._invoke('__replace_slave_tk_commands__', ip_name) @slave_ip_tbl[ip_name] = slave_ip [slave_ip, ip_name] end
__eval(str)
# File tk/lib/multi-tk.rb, line 2998 def __eval(str) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.__eval(str) end
__invoke(*args)
# File tk/lib/multi-tk.rb, line 3003 def __invoke(*args) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.__invoke(*args) end
__pseudo_toplevel()
instance method
# File tk/lib/multi-tk.rb, line 1995 def __pseudo_toplevel ip = MultiTkIp.__getip (ip == @@DEFAULT_MASTER || ip == self) && self.__pseudo_toplevel_evaluable? && @pseudo_toplevel[1] end
__pseudo_toplevel=(m)
# File tk/lib/multi-tk.rb, line 2001 def __pseudo_toplevel=(m) unless (Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER) fail SecurityError, "no permission to manipulate" end # if m.kind_of?(Module) && m.respond_to?(:pseudo_toplevel_evaluable?) if m.respond_to?(:pseudo_toplevel_evaluable?) @pseudo_toplevel[0] = true @pseudo_toplevel[1] = m else fail ArgumentError, 'fail to set pseudo-toplevel' end self end
__pseudo_toplevel_evaluable=(mode)
# File tk/lib/multi-tk.rb, line 2025 def __pseudo_toplevel_evaluable=(mode) unless (Thread.current.group == ThreadGroup::Default && MultiTkIp.__getip == @@DEFAULT_MASTER) fail SecurityError, "no permission to manipulate" end @pseudo_toplevel[0] = (mode)? true: false end
__pseudo_toplevel_evaluable?()
# File tk/lib/multi-tk.rb, line 2017 def __pseudo_toplevel_evaluable? begin @pseudo_toplevel[0] && @pseudo_toplevel[1].pseudo_toplevel_evaluable? rescue Exception false end end
_add_new_tables()
# File tk/lib/multi-tk.rb, line 1760 def _add_new_tables (@@TK_TABLE_LIST.size - @tk_table_list.size).times{ @tk_table_list << TkUtil.untrust({}) } end
_add_tk_procs(name, args, body)
# File tk/lib/multi-tk.rb, line 1770 def _add_tk_procs(name, args, body) return if slave? @interp._invoke('proc', name, args, body) if args && body @interp._invoke('interp', 'slaves').split.each{|slave| @interp._invoke('interp', 'alias', slave, name, '', name) } end
_conv_listelement(arg)
# File tk/lib/multi-tk.rb, line 3126 def _conv_listelement(arg) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._conv_listelement(arg) end
_create_slave_object(keys={})
# File tk/lib/multi-tk.rb, line 1259 def _create_slave_object(keys={}) raise SecurityError, "no permission to manipulate" unless self.manipulable? ip = MultiTkIp.new_slave(self, keys={}) @slave_ip_tbl[ip.name] = ip end
_default_delete_hook(slave)
# File tk/lib/multi-tk.rb, line 1476 def _default_delete_hook(slave) raise SecurityError, "no permission to manipulate" unless self.manipulable? @slave_ip_tbl.delete(slave) top = @slave_ip_top.delete(slave) if top.kind_of?(String) # call default hook of safetk.tcl (ignore exceptions) if top == '' begin @interp._eval("::safe::disallowTk #{slave}") rescue warn("Warning: fail to call '::safe::disallowTk'") if $DEBUG end else # toplevel path begin @interp._eval("::safe::tkDelete {} #{top} #{slave}") rescue warn("Warning: fail to call '::safe::tkDelete'") if $DEBUG begin @interp._eval("destroy #{top}") rescue warn("Warning: fail to destroy toplevel") if $DEBUG end end end end end
_destroy_slaves_of_slaveIP(ip)
# File tk/lib/multi-tk.rb, line 351 def _destroy_slaves_of_slaveIP(ip) unless ip.deleted? # ip._split_tklist(ip._invoke('interp', 'slaves')).each{|name| ip._split_tklist(ip._invoke_without_enc('interp', 'slaves')).each{|name| name = _fromUTF8(name) begin # ip._eval_without_enc("#{name} eval {foreach i [after info] {after cancel $i}}") after_ids = ip._eval_without_enc("#{name} eval {after info}") ip._eval_without_enc("#{name} eval {foreach i {#{after_ids}} {after cancel $i}}") rescue Exception end begin # ip._invoke('interp', 'eval', name, 'destroy', '.') ip._invoke(name, 'eval', 'destroy', '.') rescue Exception end # safe_base? if ip._eval_without_enc("catch {::safe::interpConfigure #{name}}") == '0' begin ip._eval_without_enc("::safe::interpDelete #{name}") rescue Exception end end if ip._invoke('interp', 'exists', name) == '1' begin ip._invoke(name, 'eval', 'exit') rescue Exception end end unless ip.deleted? if ip._invoke('interp', 'exists', name) == '1' begin ip._invoke('interp', 'delete', name) rescue Exception end end end } end end
_eval(str)
# File tk/lib/multi-tk.rb, line 3008 def _eval(str) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._eval(str) end
_eval_with_enc(str)
# File tk/lib/multi-tk.rb, line 3028 def _eval_with_enc(str) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._eval_with_enc(str) end
_eval_without_enc(str)
# File tk/lib/multi-tk.rb, line 3018 def _eval_without_enc(str) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._eval_without_enc(str) end
_fromUTF8(str, encoding=nil)
# File tk/lib/multi-tk.rb, line 3043 def _fromUTF8(str, encoding=nil) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._fromUTF8(str, encoding) end
_get_global_var(var)
# File tk/lib/multi-tk.rb, line 3088 def _get_global_var(var) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._get_global_var(var) end
_get_global_var2(var, idx)
# File tk/lib/multi-tk.rb, line 3092 def _get_global_var2(var, idx) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._get_global_var2(var, idx) end
_get_variable(var, flag)
# File tk/lib/multi-tk.rb, line 3063 def _get_variable(var, flag) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._get_variable(var, flag) end
_get_variable2(var, idx, flag)
# File tk/lib/multi-tk.rb, line 3067 def _get_variable2(var, idx, flag) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._get_variable2(var, idx, flag) end
_init_ip_env(script)
# File tk/lib/multi-tk.rb, line 1766 def _init_ip_env(script) self.eval_proc{script.call(self)} end
_init_ip_internal(init_ip_env, add_tk_procs)
# File tk/lib/multi-tk.rb, line 1794 def _init_ip_internal(init_ip_env, add_tk_procs) #init_ip_env.each{|script| self.eval_proc{script.call(self)}} init_ip_env.each{|script| self._init_ip_env(script)} add_tk_procs.each{|name, args, body| if master? @interp._invoke('proc', name, args, body) if args && body else @set_alias_proc.call(name) end } end
_invoke(*args)
# File tk/lib/multi-tk.rb, line 3013 def _invoke(*args) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke(*args) end
_invoke_with_enc(*args)
# File tk/lib/multi-tk.rb, line 3033 def _invoke_with_enc(*args) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke_with_enc(*args) end
_invoke_without_enc(*args)
# File tk/lib/multi-tk.rb, line 3023 def _invoke_without_enc(*args) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke_without_enc(*args) end
_merge_tklist(*args)
# File tk/lib/multi-tk.rb, line 3122 def _merge_tklist(*args) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._merge_tklist(*args) end
_proc_on_current_safelevel(cmd=nil, &blk)
# File tk/lib/multi-tk.rb, line 2130 def _proc_on_current_safelevel(cmd=nil, &blk) # require a block for eval safe = $SAFE cmd = _proc_on_safelevel(cmd, &blk) Proc.new{|*args| cmd.call(safe, *args)} end
_proc_on_safelevel(cmd=nil)
instance & class method
# File tk/lib/multi-tk.rb, line 2099 def _proc_on_safelevel(cmd=nil) # require a block for eval if cmd if cmd.kind_of?(Method) _proc_on_safelevel{|*args| cmd.call(*args)} else _proc_on_safelevel(&cmd) end else #Proc.new{|safe, *args| $SAFE=safe if $SAFE < safe; yield(*args)} Proc.new{|safe, *args| # avoid security error on Exception objects untrust_proc = proc{|err| begin err.untrust if err.respond_to?(:untrust) rescue SecurityError end err } $SAFE=safe if $SAFE < safe; begin yield(*args) rescue Exception => e fail untrust_proc.call(e) end } end end
_receiver_mainloop(check_root)
# File tk/lib/multi-tk.rb, line 601 def _receiver_mainloop(check_root) if @evloop_thread[0] && @evloop_thread[0].alive? @evloop_thread[0] else @evloop_thread[0] = Thread.new{ while !@interp.deleted? #if check_root # inf = @interp._invoke_without_enc('info', 'command', '.') # break if !inf.kind_of?(String) || inf != '.' #end break if check_root && !@interp.has_mainwindow? sleep 0.5 end } @evloop_thread[0] end end
_remove_tk_procs(*names)
# File tk/lib/multi-tk.rb, line 1778 def _remove_tk_procs(*names) return if slave? names.each{|name| name = name.to_s return if @interp.deleted? @interp._invoke('rename', name, '') return if @interp.deleted? @interp._invoke('interp', 'slaves').split.each{|slave| return if @interp.deleted? @interp._invoke('interp', 'alias', slave, name, '') rescue nil } } end
_return_value()
# File tk/lib/multi-tk.rb, line 3058 def _return_value raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._return_value end
_set_global_var(var, value)
# File tk/lib/multi-tk.rb, line 3096 def _set_global_var(var, value) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._set_global_var(var, value) end
_set_global_var2(var, idx, value)
# File tk/lib/multi-tk.rb, line 3100 def _set_global_var2(var, idx, value) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._set_global_var2(var, idx, value) end
_set_variable(var, value, flag)
# File tk/lib/multi-tk.rb, line 3071 def _set_variable(var, value, flag) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._set_variable(var, value, flag) end
_set_variable2(var, idx, value, flag)
# File tk/lib/multi-tk.rb, line 3075 def _set_variable2(var, idx, value, flag) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._set_variable2(var, idx, value, flag) end
_split_tklist(str)
# File tk/lib/multi-tk.rb, line 3118 def _split_tklist(str) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._split_tklist(str) end
_thread_tkwait(mode, target)
# File tk/lib/multi-tk.rb, line 3053 def _thread_tkwait(mode, target) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._thread_tkwait(mode, target) end
_thread_vwait(var)
# File tk/lib/multi-tk.rb, line 3048 def _thread_vwait(var) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._thread_vwait(var) end
_tk_cmd_tbl()
# File tk/lib/multi-tk.rb, line 1746 def _tk_cmd_tbl tbl = {} MultiTkIp.tk_cmd_tbl.each{|id, ent| tbl[id] = ent if ent.ip == self } tbl end
_toUTF8(str, encoding=nil)
# File tk/lib/multi-tk.rb, line 3038 def _toUTF8(str, encoding=nil) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._toUTF8(str, encoding) end
_unset_global_var(var)
# File tk/lib/multi-tk.rb, line 3104 def _unset_global_var(var) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._unset_global_var(var) end
_unset_global_var2(var, idx)
# File tk/lib/multi-tk.rb, line 3108 def _unset_global_var2(var, idx) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._unset_global_var2(var, idx) end
_unset_variable(var, flag)
# File tk/lib/multi-tk.rb, line 3079 def _unset_variable(var, flag) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._unset_variable(var, flag) end
_unset_variable2(var, idx, flag)
# File tk/lib/multi-tk.rb, line 3083 def _unset_variable2(var, idx, flag) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._unset_variable2(var, idx, flag) end
abort(msg = nil)
# File tk/lib/multi-tk.rb, line 2950 def abort(msg = nil) raise SecurityError, "no permission to manipulate" unless self.manipulable? if master? && !safe? && allow_ruby_exit? if msg Kernel.abort(msg) else Kernel.abort end else # ignore msg delete 1 end end
alias_delete(slave, cmd_name)
# File tk/lib/multi-tk.rb, line 3186 def alias_delete(slave, cmd_name) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke('interp', 'alias', _slavearg(slave), cmd_name, '') self end
alias_info(slave, cmd_name)
# File tk/lib/multi-tk.rb, line 3178 def alias_info(slave, cmd_name) raise SecurityError, "no permission to manipulate" unless self.manipulable? _lst2ary(@interp._invoke('interp', 'alias', _slavearg(slave), cmd_name)) end
alias_target(aliascmd, slave = '')
# File tk/lib/multi-tk.rb, line 3418 def alias_target(aliascmd, slave = '') raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke('interp', 'target', _slavearg(slave), aliascmd) end
aliases(slave = '')
# File tk/lib/multi-tk.rb, line 3207 def aliases(slave = '') raise SecurityError, "no permission to manipulate" unless self.manipulable? _lst2ary(@interp._invoke('interp', 'aliases', _slavearg(slave))) end
alive?()
# File tk/lib/multi-tk.rb, line 1678 def alive? raise SecurityError, "no permission to manipulate" unless self.manipulable? begin return false unless @cmd_receiver.alive? return false if @interp.deleted? return false if @interp._invoke('interp', 'exists', '') == '0' rescue Exception return false end true end
allow_ruby_exit=(mode)
# File tk/lib/multi-tk.rb, line 2867 def allow_ruby_exit= (mode) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.allow_ruby_exit = mode end
allow_ruby_exit?()
# File tk/lib/multi-tk.rb, line 2862 def allow_ruby_exit? raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.allow_ruby_exit? end
bg_eval(*args, &blk)
# File tk/lib/multi-tk.rb, line 2411 def bg_eval(*args, &blk) if block_given? bg_eval_proc(*args, &blk) elsif args[0] if args[0].respond_to?(:call) bg_eval_proc(*args) else bg_eval_string(*args) end else fail ArgumentError, "no argument to eval" end end
Also aliased as: background_eval
bg_eval_proc(*args)
# File tk/lib/multi-tk.rb, line 2341 def bg_eval_proc(*args) if block_given? cmd = Proc.new else unless (cmd = args.shift) fail ArgumentError, "A Proc or Method object is expected for 1st argument" end end Thread.new{ eval_proc(cmd, *args) eval_proc_core(false, proc{|safe, *params| $SAFE=safe if $SAFE < safe Thread.new(*params, &cmd).value }, safe_level, *args) } end
bg_eval_string(cmd, *eval_args)
# File tk/lib/multi-tk.rb, line 2380 def bg_eval_string(cmd, *eval_args) # cmd string ==> proc unless cmd.kind_of?(String) raise RuntimeError, "A String object is expected for the 'cmd' argument" end Thread.new{ eval_proc_core(true, proc{|safe| Kernel.eval("$SAFE=#{safe} if $SAFE < #{safe};" << cmd, *eval_args) }) } end
call(*args)
def #eval_proc(*args)
# The scope of the eval-block of 'eval_proc' method is different from # the external. If you want to pass local values to the eval-block, # use arguments of eval_proc method. They are passed to block-arguments. if block_given? cmd = Proc.new else unless (cmd = args.shift) fail ArgumentError, "A Proc or Method object is expected for 1st argument" end end if TclTkLib.mainloop_thread? == true # call from eventloop current = Thread.current backup_ip = current[:callback_ip] current[:callback_ip] = self begin eval_proc_core(false, proc{|safe, *params| $SAFE=safe if $SAFE < safe cmd.call(*params) }, *args) ensure current[:callback_ip] = backup_ip end else eval_proc_core(true, proc{|safe, *params| $SAFE=safe if $SAFE < safe Thread.new(*params, &cmd).value }, *args) end
end
# File tk/lib/multi-tk.rb, line 200 def call(*args) unless @ip.deleted? current = Thread.current backup_ip = current[:callback_ip] current[:callback_ip] = @ip begin ret = @ip.cb_eval(@cmd, *args) fail ret if ret.kind_of?(Exception) ret rescue TkCallbackBreak, TkCallbackContinue => e fail e rescue SecurityError => e # in 'exit', 'exit!', and 'abort' : security error --> delete IP if e.backtrace[0] =~ /^(.+?):(\d+):in `(exit|exit!|abort)'/ @ip.delete elsif @ip.safe? if @ip.respond_to?(:cb_error) @ip.cb_error(e) else nil # ignore end else fail e end rescue Exception => e fail e if e.message =~ /^TkCallback/ if @ip.safe? if @ip.respond_to?(:cb_error) @ip.cb_error(e) else nil # ignore end else fail e end ensure current[:callback_ip] = backup_ip end end end
cb_error(e)
# File tk/lib/multi-tk.rb, line 309 def cb_error(e) if @cb_error_proc[0].respond_to?(:call) @cb_error_proc[0].call(e) end end
cb_eval(cmd, *args)
def #cb_eval(cmd, *args)
#self.eval_callback{ TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *args)) } #ret = self.eval_callback{ TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *args)) } ret = self.eval_callback(*args){|safe, *params| $SAFE=safe if $SAFE < safe TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params)) } if ret.kind_of?(Exception) raise ret end ret
end
# File tk/lib/multi-tk.rb, line 1928 def cb_eval(cmd, *args) self.eval_callback(*args, &_proc_on_safelevel{|*params| TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params)) }) end
def_alias(slave, new_cmd, org_cmd, *args)
# File tk/lib/multi-tk.rb, line 3196 def def_alias(slave, new_cmd, org_cmd, *args) raise SecurityError, "no permission to manipulate" unless self.manipulable? ret = @interp._invoke('interp', 'alias', _slavearg(slave), new_cmd, '', org_cmd, *args) (ret == new_cmd)? self: nil end
default_encoding=(enc)
# File tk/lib/multi-tk.rb, line 3645 def default_encoding=(enc) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.default_encoding = enc end
delete()
# File tk/lib/multi-tk.rb, line 2872 def delete raise SecurityError, "no permission to manipulate" unless self.manipulable? @slave_ip_tbl.each{|name, subip| _destroy_slaves_of_slaveIP(subip) begin subip._invoke('destroy', '.') unless subip.deleted? rescue Exception end begin # subip._eval_without_enc("foreach i [after info] {after cancel $i}") unless subip.deleted? after_ids = subip._eval_without_enc("after info") subip._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}") end rescue Exception end # safe_base? if @interp._eval_without_enc("catch {::safe::interpConfigure #{name}}") == '0' begin @interp._eval_without_enc("::safe::interpDelete #{name}") rescue Exception else next if subip.deleted? end end if subip.respond_to?(:safe_base?) && subip.safe_base? && !subip.deleted? # do 'exit' to call the delete_hook procedure begin subip._eval_without_enc('exit') rescue Exception end else begin subip.delete unless subip.deleted? rescue Exception end end } begin # @interp._eval_without_enc("foreach i [after info] {after cancel $i}") after_ids = @interp._eval_without_enc("after info") @interp._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}") rescue Exception end begin @interp._invoke('destroy', '.') unless @interp.deleted? rescue Exception end if @safe_base && !@interp.deleted? # do 'exit' to call the delete_hook procedure @interp._eval_without_enc('exit') end @interp.delete self end
delete_cmd(slave, cmd)
# File tk/lib/multi-tk.rb, line 3235 def delete_cmd(slave, cmd) raise SecurityError, "no permission to manipulate" unless self.manipulable? slave_invoke = @interp._invoke('list', 'rename', cmd, '') @interp._invoke('interp', 'eval', _slavearg(slave), slave_invoke) self end
delete_slaves(*args)
# File tk/lib/multi-tk.rb, line 3215 def delete_slaves(*args) raise SecurityError, "no permission to manipulate" unless self.manipulable? slaves = args.collect{|s| _slavearg(s)} @interp._invoke('interp', 'delete', *slaves) if slaves.size > 0 self end
deleted?()
# File tk/lib/multi-tk.rb, line 2935 def deleted? raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.deleted? end
encoding=(enc)
# File tk/lib/multi-tk.rb, line 3650 def encoding=(enc) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.encoding = enc end
encoding_convertfrom(str, enc=None)
# File tk/lib/multi-tk.rb, line 3665 def encoding_convertfrom(str, enc=None) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.encoding_convertfrom(str, enc) end
Also aliased as: encoding_convert_from
encoding_convertto(str, enc=None)
# File tk/lib/multi-tk.rb, line 3671 def encoding_convertto(str, enc=None) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.encoding_convertto(str, enc) end
Also aliased as: encoding_convert_to
encoding_name()
# File tk/lib/multi-tk.rb, line 3654 def encoding_name raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.encoding_name end
Also aliased as: encoding, default_encoding
encoding_obj()
# File tk/lib/multi-tk.rb, line 3658 def encoding_obj raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.encoding_obj end
eval(*args, &blk)
# File tk/lib/multi-tk.rb, line 2397 def eval(*args, &blk) if block_given? eval_proc(*args, &blk) elsif args[0] if args[0].respond_to?(:call) eval_proc(*args) else eval_string(*args) end else fail ArgumentError, "no argument to eval" end end
eval_callback(*args)
Not stable, so disable this feature
# File tk/lib/multi-tk.rb, line 2235 def eval_callback(*args) if block_given? cmd = Proc.new else cmd = args.shift end begin if @@CALLBACK_SUBTHREAD.table[self].index(Thread.current) last_th = nil else last_th = @@CALLBACK_SUBTHREAD.table[self][-1] end @@CALLBACK_SUBTHREAD.new(self){ @@CALLBACK_SUBTHREAD.table[self] << Thread.current begin last_th.join if last_th eval_proc_core(false, cmd, *args) rescue Exception=>e e ensure @@CALLBACK_SUBTHREAD.table[self].delete(Thread.current) end } end end
eval_proc(*args, &blk)
# File tk/lib/multi-tk.rb, line 2276 def eval_proc(*args, &blk) if block_given? cmd = _proc_on_safelevel(&blk) else unless (cmd = args.shift) fail ArgumentError, "A Proc or Method object is expected for 1st argument" end cmd = _proc_on_safelevel(&cmd) end if TclTkLib.mainloop_thread? == true # call from eventloop current = Thread.current backup_ip = current[:callback_ip] current[:callback_ip] = self begin eval_proc_core(false, cmd, *args) ensure current[:callback_ip] = backup_ip end else eval_proc_core(true, proc{|safe, *params| Thread.new{cmd.call(safe, *params)}.value }, *args) end end
Also aliased as: call
eval_string(cmd, *eval_args)
# File tk/lib/multi-tk.rb, line 2366 def eval_string(cmd, *eval_args) # cmd string ==> proc unless cmd.kind_of?(String) raise RuntimeError, "A String object is expected for the 'cmd' argument" end eval_proc_core(true, proc{|safe| Kernel.eval("$SAFE=#{safe} if $SAFE < #{safe};" << cmd, *eval_args) }) end
Also aliased as: eval_str
exist?(slave = '')
# File tk/lib/multi-tk.rb, line 3226 def exist?(slave = '') raise SecurityError, "no permission to manipulate" unless self.manipulable? ret = @interp._invoke('interp', 'exists', _slavearg(slave)) (ret == '1')? true: false end
exit(st = true)
# File tk/lib/multi-tk.rb, line 2965 def exit(st = true) raise SecurityError, "no permission to manipulate" unless self.manipulable? if master? && !safe? && allow_ruby_exit? Kernel.exit(st) else delete st end end
exit!(st = false)
# File tk/lib/multi-tk.rb, line 2975 def exit!(st = false) raise SecurityError, "no permission to manipulate" unless self.manipulable? if master? && !safe? && allow_ruby_exit? Kernel.exit!(st) else delete st end end
expose_cmd(slave, cmd, aliasname = nil)
# File tk/lib/multi-tk.rb, line 3246 def expose_cmd(slave, cmd, aliasname = nil) raise SecurityError, "no permission to manipulate" unless self.manipulable? if aliasname @interp._invoke('interp', 'expose', _slavearg(slave), cmd, aliasname) else @interp._invoke('interp', 'expose', _slavearg(slave), cmd) end self end
force_default_encoding=(mode)
# File tk/lib/multi-tk.rb, line 3636 def force_default_encoding=(mode) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.force_default_encoding = mode end
force_default_encoding?()
# File tk/lib/multi-tk.rb, line 3640 def force_default_encoding? raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.force_default_encoding? end
get_bgerror_handler(slave = '')
# File tk/lib/multi-tk.rb, line 3368 def get_bgerror_handler(slave = '') raise SecurityError, "no permission to manipulate" unless self.manipulable? procedure(@interp._invoke('interp', 'bgerror', _slavearg(slave))) end
get_limit(limit_type, slave = '', slot = nil)
# File tk/lib/multi-tk.rb, line 3384 def get_limit(limit_type, slave = '', slot = nil) raise SecurityError, "no permission to manipulate" unless self.manipulable? if slot num_or_str(@interp._invoke('interp', 'limit', _slavearg(slave), limit_type, slot)) else l = @interp._split_tklist(@interp._invoke_without_enc('interp', 'limit', _slavearg(slave), limit_type)) l.map!{|s| _fromUTF8(s)} r = {} until l.empty? key = l.shift[1..-1] val = l.shift val = num_or_str(val) if val r[key] = val end r end end
has_mainwindow?()
# File tk/lib/multi-tk.rb, line 2940 def has_mainwindow? raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.has_mainwindow? end
hide_cmd(slave, cmd, aliasname = nil)
# File tk/lib/multi-tk.rb, line 3260 def hide_cmd(slave, cmd, aliasname = nil) raise SecurityError, "no permission to manipulate" unless self.manipulable? if aliasname @interp._invoke('interp', 'hide', _slavearg(slave), cmd, aliasname) else @interp._invoke('interp', 'hide', _slavearg(slave), cmd) end self end
invalid_namespace?()
# File tk/lib/multi-tk.rb, line 2945 def invalid_namespace? raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.invalid_namespace? end
mainloop(check_root = true, restart_on_dead = false)
def mainloop(check_root = true, restart_on_dead = true)
# File tk/lib/multi-tk.rb, line 2737 def mainloop(check_root = true, restart_on_dead = false) raise SecurityError, "no permission to manipulate" unless self.manipulable? if WITH_RUBY_VM ### Ruby 1.9 !!!!!!!!!!! return @interp_thread.value if @interp_thread end #return self if self.slave? #return self if self != @@DEFAULT_MASTER if self != @@DEFAULT_MASTER if @wait_on_mainloop[0] begin @wait_on_mainloop[1] += 1 @cmd_queue.enq([@system, 'call_mainloop', Thread.current, check_root]) Thread.stop rescue MultiTkIp_OK => ret # return value if ret.value.kind_of?(Thread) return ret.value.value else return ret.value end rescue SystemExit => e # exit IP warn("Warning: " + e.inspect + " on " + self.inspect) if $DEBUG begin self._eval_without_enc('exit') rescue Exception end self.delete rescue StandardError => e if $DEBUG warn("Warning: " + e.class.inspect + ((e.message.length > 0)? ' "' + e.message + '"': '') + " on " + self.inspect) end return e rescue Exception => e return e ensure @wait_on_mainloop[1] -= 1 end end return end unless restart_on_dead @wait_on_mainloop[1] += 1 begin @interp.mainloop(check_root) rescue StandardError => e if $DEBUG warn("Warning: " + e.class.inspect + ((e.message.length > 0)? ' "' + e.message + '"': '') + " on " + self.inspect) end end begin @interp.mainloop(check_root) ensure @wait_on_mainloop[1] -= 1 end else loop do break unless self.alive? if check_root begin break if TclTkLib.num_of_mainwindows == 0 rescue StandardError break end end break if @interp.deleted? begin @wait_on_mainloop[1] += 1 @interp.mainloop(check_root) rescue StandardError => e if TclTkLib.mainloop_abort_on_exception != nil #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect, # " exception (ignore) : ", $!.message, "\n"); if $DEBUG warn("Warning: Tk mainloop receives " << e.class.inspect << " exception (ignore) : " << e.message); end end #raise e rescue Exception => e if TclTkLib.mainloop_abort_on_exception != nil #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect, # " exception (ignore) : ", $!.message, "\n"); if $DEBUG warn("Warning: Tk mainloop receives " << e.class.inspect << " exception (ignore) : " << e.message); end end raise e ensure @wait_on_mainloop[1] -= 1 Thread.pass # avoid eventloop conflict end end end self end
make_safe()
# File tk/lib/multi-tk.rb, line 2847 def make_safe raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.make_safe end
manipulable?()
# File tk/lib/multi-tk.rb, line 1728 def manipulable? return true if (Thread.current.group == ThreadGroup::Default) ip = MultiTkIp.__getip (ip == self) || ip._is_master_of?(@interp) end
mark_trusted(slave = '')
# File tk/lib/multi-tk.rb, line 3341 def mark_trusted(slave = '') raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke('interp', 'marktrusted', _slavearg(slave)) self end
recursion_limit(slave = '', limit = None)
# File tk/lib/multi-tk.rb, line 3409 def recursion_limit(slave = '', limit = None) raise SecurityError, "no permission to manipulate" unless self.manipulable? number(@interp._invoke('interp', 'recursionlimit', _slavearg(slave), limit)) end
restart(app_name = nil, keys = {})
# File tk/lib/multi-tk.rb, line 2985 def restart(app_name = nil, keys = {}) raise SecurityError, "no permission to manipulate" unless self.manipulable? _init_ip_internal(@@INIT_IP_ENV, @@ADD_TK_PROCS) @interp._invoke('set', 'argv0', app_name) if app_name if keys.kind_of?(Hash) @interp._invoke('set', 'argv', _keys2opts(keys)) end @interp.restart end
running_mainloop?()
# File tk/lib/multi-tk.rb, line 347 def running_mainloop? @wait_on_mainloop[1] > 0 end
safe?()
# File tk/lib/multi-tk.rb, line 2852 def safe? raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp.safe? end
safe_base?()
# File tk/lib/multi-tk.rb, line 2857 def safe_base? raise SecurityError, "no permission to manipulate" unless self.manipulable? @safe_base end
safe_level=(safe)
# File tk/lib/multi-tk.rb, line 324 def safe_level=(safe) set_safe_level(safe) end
safeip_add_to_access_path(dir)
# File tk/lib/multi-tk.rb, line 3572 def safeip_add_to_access_path(dir) ip = MultiTkIp.__getip ip._eval("::safe::interpAddToAccessPath #{@ip_name} #{dir}") end
safeip_configinfo(slot = nil)
# File tk/lib/multi-tk.rb, line 3527 def safeip_configinfo(slot = nil) ip = MultiTkIp.__getip ret = {} if slot conf = _lst2ary(ip._eval("::safe::interpConfigure " + @ip_name + " -#{slot}")) if conf[0] == '-deleteHook' if conf[1] =~ /^rb_out\S* (c(_\d+_)?\d+)/ ret[conf[0][1..-1]] = MultiTkIp._tk_cmd_tbl[$1] if conf[1] =~ /rb_out\S*(?:\s+(::\S*|[{](::.*)[}]|["](::.*)["]))? (c(_\d+_)?(\d+))/ ret[conf[0][1..-1]] = MultiTkIp._tk_cmd_tbl[$4] else ret[conf[0][1..-1]] = conf[1] end else ret[conf[0][1..-1]] = conf[1] end else Hash[*_lst2ary(ip._eval("::safe::interpConfigure " + @ip_name))].each{|k, v| if k == '-deleteHook' if v =~ /^rb_out\S* (c(_\d+_)?\d+)/ ret[k[1..-1]] = MultiTkIp._tk_cmd_tbl[$1] if v =~ /rb_out\S*(?:\s+(::\S*|[{](::.*)[}]|["](::.*)["]))? (c(_\d+_)?(\d+))/ ret[k[1..-1]] = MultiTkIp._tk_cmd_tbl[$4] else ret[k[1..-1]] = v end else ret[k[1..-1]] = v end } end ret end
safeip_configure(slot, value=None)
# File tk/lib/multi-tk.rb, line 3514 def safeip_configure(slot, value=None) # use for '-noStatics' option ==> {statics=>false} # for '-nestedLoadOk' option ==> {nested=>true} if slot.kind_of?(Hash) ip = MultiTkIp.__getip ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + _keys2opts(slot)) else ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + "-#{slot} #{_get_eval_string(value)}") end self end
safeip_delete()
# File tk/lib/multi-tk.rb, line 3567 def safeip_delete ip = MultiTkIp.__getip ip._eval("::safe::interpDelete " + @ip_name) end
safeip_find_in_access_path(dir)
# File tk/lib/multi-tk.rb, line 3577 def safeip_find_in_access_path(dir) ip = MultiTkIp.__getip ip._eval("::safe::interpFindInAccessPath #{@ip_name} #{dir}") end
safeip_set_log_cmd(cmd = Proc.new)
# File tk/lib/multi-tk.rb, line 3582 def safeip_set_log_cmd(cmd = Proc.new) ip = MultiTkIp.__getip ip._eval("::safe::setLogCmd #{@ip_name} #{_get_eval_string(cmd)}") end
set_bgerror_handler(cmd = Proc.new, slave = nil, &b)
# File tk/lib/multi-tk.rb, line 3351 def set_bgerror_handler(cmd = Proc.new, slave = nil, &b) raise SecurityError, "no permission to manipulate" unless self.manipulable? unless TkComm._callback_entry?(cmd) if !slave && b slave = cmd cmd = Proc.new(&b) end end slave = '' unless slave @interp._invoke('interp', 'bgerror', _slavearg(slave), cmd) end
set_cb_error(cmd = Proc.new)
# File tk/lib/multi-tk.rb, line 305 def set_cb_error(cmd = Proc.new) @cb_error_proc[0] = cmd end
set_limit(limit_type, slave = '', opts = {})
# File tk/lib/multi-tk.rb, line 3376 def set_limit(limit_type, slave = '', opts = {}) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke('interp', 'limit', _slavearg(slave), limit_type, opts) end
set_safe_level(safe)
# File tk/lib/multi-tk.rb, line 317 def set_safe_level(safe) if safe > @safe_level[0] @safe_level[0] = safe @cmd_queue.enq([@system, 'set_safe_level', safe]) end @safe_level[0] end
slaves(all = false)
# File tk/lib/multi-tk.rb, line 1712 def slaves(all = false) raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke('interp','slaves').split.map!{|name| if @slave_ip_tbl.key?(name) @slave_ip_tbl[name] elsif all name else nil end }.compact! end
transfer_stderr(dist, src = '')
# File tk/lib/multi-tk.rb, line 3476 def transfer_stderr(dist, src = '') raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke('interp', 'transfer', src, 'stderr', dist) self end
transfer_stdin(dist, src = '')
# File tk/lib/multi-tk.rb, line 3456 def transfer_stdin(dist, src = '') raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke('interp', 'transfer', src, 'stdin', dist) self end
transfer_stdio(dist, src = '')
# File tk/lib/multi-tk.rb, line 3498 def transfer_stdio(dist, src = '') raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke('interp', 'transfer', src, 'stdin', dist) @interp._invoke('interp', 'transfer', src, 'stdout', dist) @interp._invoke('interp', 'transfer', src, 'stderr', dist) self end
transfer_stdout(dist, src = '')
# File tk/lib/multi-tk.rb, line 3466 def transfer_stdout(dist, src = '') raise SecurityError, "no permission to manipulate" unless self.manipulable? @interp._invoke('interp', 'transfer', src, 'stdout', dist) self end