Class: Tk::CheckButton
- Defined in:
- lib/ffi-tk/widget/checkbutton.rb
Overview
Create and manipulate checkbutton widgets
Direct Known Subclasses
Constant Summary
Constants included from Cget
Constants included from WM
Instance Attribute Summary
Attributes inherited from Widget
Class Method Summary collapse
Instance Method Summary collapse
-
#deselect ⇒ Object
Deselects the checkbutton and sets the associated variable to its “off” value.
-
#flash ⇒ Object
Flashes the checkbutton.
-
#initialize(parent = Tk.root, options = None) ⇒ CheckButton
constructor
A new instance of CheckButton.
-
#invoke ⇒ Object
Does just what would have happened if the user invoked the checkbutton with the mouse: toggle the selection state of the button and invoke the Tcl command associated with the checkbutton, if there is one.
-
#select ⇒ Object
Selects the checkbutton and sets the associated variable to its “on” value.
-
#toggle ⇒ Object
Toggles the selection state of the button, redisplaying it and modifying its associated variable to reflect the new state.
Methods included from Cget
#cget, option_hash_to_tcl, option_to_ruby, type_to_ruby
Methods included from Configure
Methods inherited from Button
Methods inherited from Widget
#execute, #execute_only, #focus, #focus_next, #focus_prev, #lower, #raise, #to_tcl
Methods included from Pack
configure, forget, info, pack, #pack, #pack_configure, #pack_forget, #pack_info, #pack_propagate, #pack_slaves, propagate, slaves
Methods included from Destroy
Methods included from Bind
Methods included from Bindtags
Methods included from WM
aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, forget, frame, geometry, grid, group, iconbitmap, iconbitmap_default, iconify, iconmask, iconname, iconphoto, iconphoto_default, iconposition, iconwindow, manage, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, withdraw, #wm_aspect, #wm_aspect=, #wm_attributes, #wm_client, #wm_client=, #wm_colormapwindows, #wm_colormapwindows=, #wm_command, #wm_command=, #wm_deiconify, #wm_focusmodel, #wm_focusmodel=, #wm_forget, #wm_frame, #wm_geometry, #wm_geometry=, #wm_grid, #wm_grid=, #wm_group, #wm_group=, #wm_iconbitmap, #wm_iconbitmap=, #wm_iconbitmap_default, #wm_iconbitmap_default=, #wm_iconify, #wm_iconmask, #wm_iconmask=, #wm_iconname, #wm_iconname=, #wm_iconphoto, #wm_iconphoto=, #wm_iconphoto_default, #wm_iconphoto_default=, #wm_iconposition, #wm_iconposition=, #wm_iconwindow, #wm_iconwindow=, #wm_manage, #wm_maxsize, #wm_minsize, #wm_overrideredirect, #wm_overrideredirect=, #wm_positionfrom, #wm_positionfrom=, #wm_protocol, #wm_resizable, #wm_sizefrom, #wm_sizefrom=, #wm_stackorder, #wm_state, #wm_state=, #wm_title, #wm_title=, #wm_transient, #wm_transient=, #wm_withdraw
Methods included from Winfo
atom, atomname, cells, children, class_name, colormapfull, containing, depth, exists, fpixels, geometry, height, id, interps, ismapped, manager, name, parent, pathname, pixels, pointerx, pointerxy, pointery, reqheight, reqwidth, rgb, rootx, rooty, screen, screencells, screendepth, screenheight, screenmmheight, screenmmwidth, screenvisual, screenwidth, server, toplevel, viewable, visual, visualid, visualsavailable, vrootheight, vrootwidth, vrootx, vrooty, width, #winfo_atom, #winfo_atomname, #winfo_cells, #winfo_children, #winfo_class, #winfo_colormapfull, #winfo_containing, #winfo_depth, #winfo_exists, #winfo_fpixels, #winfo_geometry, #winfo_height, #winfo_id, #winfo_interps, #winfo_ismapped, #winfo_manager, #winfo_name, #winfo_parent, #winfo_pathname, #winfo_pixels, #winfo_pointerx, #winfo_pointerxy, #winfo_pointery, #winfo_reqheight, #winfo_reqwidth, #winfo_rgb, #winfo_rootx, #winfo_rooty, #winfo_screen, #winfo_screencells, #winfo_screendepth, #winfo_screenheight, #winfo_screenmmheight, #winfo_screenmmwidth, #winfo_screenvisual, #winfo_screenwidth, #winfo_server, #winfo_toplevel, #winfo_viewable, #winfo_visual, #winfo_visualid, #winfo_visualsavailable, #winfo_vrootheight, #winfo_vrootwidth, #winfo_vrootx, #winfo_vrooty, #winfo_width, #winfo_x, #winfo_y, x, y
Methods included from Grid
anchor, bbox, columnconfigure, configure, forget, #grid_anchor, #grid_bbox, #grid_columnconfigure, #grid_configure, #grid_forget, #grid_info, #grid_location, #grid_propagate, #grid_remove, #grid_rowconfigure, #grid_size, #grid_slave, #grid_slaves, info, location, propagate, remove, rowconfigure, size, slave, slaves
Methods included from Clipboard
append, clear, #clipboard_append, #clipboard_clear, #clipboard_get, #clipboard_set, get, set
Methods included from Place
configure, forget, info, place, #place, #place_configure, #place_forget, #place_info, #place_slaves, slaves
Methods included from TkCmd
appname, caret, inactive, scaling, #tk_appname, #tk_appname=, #tk_caret, #tk_inactive, #tk_scaling, #tk_scaling=, #tk_useinputmethods, #tk_useinputmethods=, #tk_windowingsystem, useinputmethods, windowingsystem
Constructor Details
#initialize(parent = Tk.root, options = None) ⇒ CheckButton
Returns a new instance of CheckButton.
11 12 13 14 15 16 17 18 19 |
# File 'lib/ffi-tk/widget/checkbutton.rb', line 11 def initialize(parent = Tk.root, = None) if block_given? super do || [:command] = register_command(:command, &Proc.new) end else super end end |
Class Method Details
.tk_command ⇒ Object
7 8 9 |
# File 'lib/ffi-tk/widget/checkbutton.rb', line 7 def self.tk_command 'checkbutton' end |
Instance Method Details
#deselect ⇒ Object
Deselects the checkbutton and sets the associated variable to its “off” value.
23 24 25 |
# File 'lib/ffi-tk/widget/checkbutton.rb', line 23 def deselect execute_only(:deselect) end |
#flash ⇒ Object
Flashes the checkbutton. This is accomplished by redisplaying the checkbutton several times, alternating between active and normal colors. At the end of the flash the checkbutton is left in the same normal/active state as when the command was invoked. This command is ignored if the checkbutton’s state is disabled.
33 34 35 |
# File 'lib/ffi-tk/widget/checkbutton.rb', line 33 def flash execute_only(:flash) end |
#invoke ⇒ Object
Does just what would have happened if the user invoked the checkbutton with the mouse: toggle the selection state of the button and invoke the Tcl command associated with the checkbutton, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the checkbutton. This command is ignored if the checkbutton’s state is disabled.
43 44 45 |
# File 'lib/ffi-tk/widget/checkbutton.rb', line 43 def invoke execute_only(:invoke) end |
#select ⇒ Object
Selects the checkbutton and sets the associated variable to its “on” value.
49 50 51 |
# File 'lib/ffi-tk/widget/checkbutton.rb', line 49 def select execute_only(:select) end |
#toggle ⇒ Object
Toggles the selection state of the button, redisplaying it and modifying its associated variable to reflect the new state. pressed over a checkbutton, the button activates whenever the mouse pointer is inside the button, and deactivates whenever the mouse pointer leaves the button. minus (-) deselects the button. labelframe .lbl -text “Steps:” checkbutton .c1 -text Lights -variable lights checkbutton .c2 -text Cameras -variable cameras checkbutton .c3 -text Action! -variable action pack .c1 .c2 .c3 -in .lbl pack .lbl
62 63 64 |
# File 'lib/ffi-tk/widget/checkbutton.rb', line 62 def toggle execute_only(:toggle) end |