Tcl-Tk Code 'Snippets' Sources

especially for
PROCS
(Tcl-Tk procedures)

Snippets from
scripts in the
FE 'tkGooies' system
--- and
from other sources.

(Snippets to facilitate
development of Tk GUI's.)
(FE = Freedom Environment)

This animated-GIF was created
with the wheeeMorph' script
of the FE 'tkGooies' system.

FE Home page > FE Downloads page >

FE 'tkGooies' Download page >

'tkGooies' Description page >

'Tcl-Tk Code Snippets Sources' page >

This 'Tcl-Tk PROCEDURE (proc) Sources' page

! Preliminary !
This page is missing script-and-proc names in
several function categories. To be 'rounded out'
if/when I re-visit to this page.

! Note !
More links to sources of Tcl-Tk 'proc' code snippets
may be added --- as more and more scripts are added
to the FE 'tkGooies' subsystem.

< Go to Table of Contents, below >
(SKIP THIS INTRO)

INTRODUCTION to PROC code snippets:

As I develop more and more Tk GUI scripts in the FE 'tkGooies' subsystem --- a subsystem in the group of FE (Freedom Environment) subsystems, I find it extremely helpful to copy 'snippets' of 'proc' code from an 'old' tkGooie script for use in a new 'tkGooie'.

Then I, typically, make some changes to variable names and widget names. (OLD to NEW)

    Also, as I find better ways of doing things in 'new' tkGooie scripts, I find that I will someday want to go back to 'old' tkGooie scripts and implement those better-ways in the old scripts. (NEW to OLD)

As I publish a script of the 'tkGooies' system in the CODE pages that are available via the 'tkGooies' Description page, I hope that that particular 'tkGooie' script may help others to learn to make Tcl-Tk scripts that are of interest to them.

In the course of these activities ('tkGooie' code development and 'tkGooie' code publishing), I realized that it will be of help to me --- and to other potential Tcler's --- to have a web page that points to sources of various kinds of Tcl-Tk code 'snippets'.

I quickly realized that, when I am looking for a Tcl-Tk code snippet, I am usually looking for a snippet that is of one of 3 general kinds:

  • a WIDGET -
    an example of DEFINITION (and packing) of a widget

  • a BINDING -
    an example of binding an EVENT (and action) to a widget

  • a PROC -
    an example to perform a SPECIFIC FUNCTION, such as file-reading, or file-writing, or plotting lines/ovals/polygons on a canvas, or plotting pixels in a photo-image on a canvas, or performing a certain kind of calculation, or whatever.

It is the purpose of this page to provide examples of 'procs' (Tcl-Tk procedures) --- via links to web pages that present Tcl-Tk code.

---

Most of the links (below) will be to the 'CODE pages' of my 'tkGooies' system --- pages of this FE (Freedom Environment) web site, www.freedomenv.com.

But some links may be 'external' links --- to helpful pages at the Tcler's wiki --- wiki.tcl.tk --- or elsewhere on the web.


Organization of the links below :

A 'Table of Contents' section below can be used to take you to a section of the page below --- where each section corresponds to a 'function category' --- and each section consists of links to code corresponding to that 'function category'.

These sections are given names like '3Dtools', 'IMAGEtools', 'PLOTtools' --- similar to the toolchest categories of the 'tkGooies' system.

Each link in these sections takes you to code for a Tk script.

The name in the link is a set of words that indicate the function of the script. In other words, the name in the link is a 'script-identifying name'.

Under each link (under each 'script-identifying name'), the names of the 'procs' used in the script are also presented.

The name of each proc usually provides an indication of the function of the proc.

These 'script-identifying names' and proc-names offer a way of finding a proc that may be useful to me (or you).

In addition to finding a link via the 'Table of Contents' below, you can use the 'Find in Page' option of your web browser to find 'keywords' on this page, such as terms related to a procedure-function --- terms such as :

    'read' or 'write' or 'file' or 'filename' or 'image' or 'img' or 'gif' or 'png' or 'jpeg' or 'jpg' or 'plot' or 'draw' or 'rotate' or 'magnify' or 'transform' or 'translate' or 'calc' or 'shade' or 'pixel' or 'px' or '3d' or '2d' or 'canvas' or 'button' or 'butt' or 'entry' or 'list' or 'sort' or 'warp' or 'color' or 'font' or ...

Thus, you should be able to find procs that perform functions of interest, such as

  • file-reading
  • file-writing
  • plotting lines/ovals/polygons on a Tk canvas
  • plotting pixels in a Tk photo-image on a canvas
  • etc. etc.

If you locate your 'keyword' in a proc-name or in a 'script-identifying name', then you can use the associated link to take you to a web page that presents the script code that contains the proc (or procs) of interest.


There is a standardized Tk coding structure that I use in the development of 'tkGooie' scripts.

I describe that coding structure on a page of this site titled A Canonical Structure for Tk Code --- and variations.

In that coding structure, I basically organize the code to include 3 main sections:

  • widget definitions
    (the layout of the GUI) --- typically involving defining 'frame' widgets, and then widgets within those frames --- widgets like 'button' widgets, 'label' widgets, 'entry' widgets, etc.

  • 'bind' statements,
    if any are needed in addition to the default bindings that are provided with the Tk widgets.

    The 'bind' statements provide code to be executed when certain 'events' occur, such as moving a mouse on a Tk 'canvas' widget.

  • procs (procedures)
    which may involve various kinds of algorithms to perform calculations, to draw images, to read files, to write files, to execute external programs, etc.

If you go to a page that contains code for an FE 'tkGooie' script, you can find the proc(s) of interest by scrolling down to the bottom-half of the 'tkGooie' code to find the 'PROCS' section.

OR, you can use the text-search function of your web browser to find occurrences of the proc-name in the code.


Enough of this introduction.

Belwo is the 'Table of Contents' --- a table of links.

The table of contents below provides links to sections of THIS web page that contain links to take the reader to locally-stored (or remotely-stored) code --- code that contains snippets that may help in making more Tk GUI's.

Table of Contents:

(links to sections of this page, below)

(in numero-alphabetic order by
function/category name)

End of Table of Contents.

Start of Sections of Links to Code Snippets.

Some Sources of
'3Dtools' procs :

  • 3Dexaminer_forFunctionsOf2XYvars
    includes a listbox to provide functions of 2 variables.
    PROC NAMES:

    • listboxSelectionTOentryString
    • load_points_array
    • translate_points_array
    • rotate_points
    • draw_2D_pixel_polys
    • update_status_label
    • load-translate-rotate-draw
    • rotate-draw
    • wrap_draw_2D_pixel_polys
    • set_polygon_color1
    • set_polygon_color2
    • set_background_color
    • update_colors_label
    • popup_msg_var_scroll
  • 3Dexaminer_forParametricSurfacesOf2vars
    includes a listbox to provide parametric functions.
    PROC NAMES:

    • listboxSelectionTOentryStrings
    • load_points_array
    • translate_points_array
    • rotate_points
    • sort_polyIDs_list
    • draw_2D_pixel_polys
    • compare_2polyIDs_by_zdepth
    • update_status_label
    • load-translate-rotate-sort-draw
    • rotate-sort-draw
    • wrap_draw_2D_pixel_polys
    • set_polygon_color1
    • set_polygon_color2
    • set_background_color
    • update_colors_label
    • popup_msg_var_scroll
  • 3DmodelExaminer_readModelFiles
    includes procs to read OBJ, PLY, OFF, and STL files
    and parse them.
    PROC NAMES:

    • get_model_filename
    • get_chars_before_last
    • load_3DfileData
    • load_3DfileData_cOBJ
    • load_3DfileData_PLY
    • load_3DfileData_OFF
    • load_3DfileData_STL
    • update_counts_label
    • translate_points_array
    • rotate_points
    • sort_polyIDs_list
    • draw_2D_pixel_polys
    • compare_2polyIDs_by_zdepth
    • update_drawtime_label
    • load-translate-rotate-sort-draw
    • rotate-sort-draw
    • wrap_draw_2D_pixel_polys
    • set_polygon_color1
    • set_polygon_color2
    • set_background_color
    • update_colors_label
    • enable_fillsrc_radbutts
    • disable_fillsrc_radbutts
    • enable_shade_radbutts
    • disable_shade_radbutts
    • cross_product_normz
    • popup_msgVarWithScroll
    • popup_msgVarWithScroll_wait
  • 3DterrainGeneratorExaminer_ fromImgFiles
    includes a proc to read image data to create 3D data.
    PROC NAMES:

    • get_image_filename
    • load-translate-rotate-sort-draw
    • rotate-sort-draw
    • wrap_draw_2D_pixel_polys
    • update_draw-time_label
    • load_points_array
    • translate_points_array
    • rotate_points
    • sort_polyIDs_list
    • compare_2polyIDs_by_XXXxdepth
    • draw_2D_pixel_polys
    • set_polygon_color1
    • set_polygon_color2
    • set_background_color
    • update_colors_label
    • enable_fillsrc_radbutts
    • disable_fillsrc_radbutts
    • enable_shade_radbutts
    • disable_shade_radbutts
    • cross_product_normx
    • popup_msgVarWithScroll
    • popup_msgVarWithScroll_wait

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'AUDIOtools' procs :

  • tkAudioClipChgVolumeConvertEtc_ffmpegFrontEnd
    (clip / change-volume / convert / etc an audio file,
    yielding a new audio file)
    (This is a front end for some audio editing functions
    of the 'ffmpeg' command.)
    PROC NAMES:

    • get_INfilename
    • set_defaults_for_encoding
    • loadOptsFrame_perListboxSelection
    • exec_audio_operation
    • play_audio_file
    • set_width_of_labels
    • pack_more_outparms_frame

    For each Exec-Option in the AudioEdits listbox,
    a 'show_*_opts' proc and a 'set_*_cmd' proc
    should be provided --- like the following.

    • 'show_CLIP_opts' and 'set_CLIP_cmd'
    • 'show_CHG-VOLUME_opts'
    • 'set_CHG-VOLUME_cmd'
    • 'show_PROPSin_opts'
    • 'set_PROPSin_cmd'
    • 'show_PROPSout_opts'
    • 'set_PROPSout_cmd'
    • 'show_CONVERT_opts'
    • 'set_CONVERT_cmd'
  • Several more AUDIOtools scripts
    (and their procs)
    are to be shown here.

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'FILEmanagers' procs :

  • tkScriptApplicator
    (for selecting-and-applying a script
    to one or more selected files)

    This application is composed of 3 'tkGooie' scripts:

    tkScriptApplicator_ multifilesSelector_ 2listboxes.tk
    PROC NAMES:

    • fill_lists
    • get_subdirs_inCURdir_inclLinks
    • get_files_inCURdir_inclLinks
    • get_selected_files
    • navigate
    • jump2dir
    • dirSelector_orEditListOfFavorites_1listbox.tk
    • selectANDapply_script
    • set_status_msg
    • toggle_fontsize
    • toggle_ybars
    • popup_msgVarWithScroll

    The following 6 procs are for
    window/widget resizing buttons:

    • dir_listbox_width_increase
    • dir_listbox_width_reduce
    • fil_listbox_width_increase
    • fil_listbox_width_reduce
    • tall_win
    • short_win

    scriptSelector_2listboxes.tk
    PROC NAMES:

    • fill_lists
    • get_subdirs_inCURdir
    • get_files_inCURdir
    • get_selected_file
    • navigate
    • set_status_msg
    • put_var_exit
    • toggle_fontsize
    • toggle_ybars
    • popup_msgVarWithScroll

    The following 6 procs are 'called' by the
    'naroDir', ..., 'shortWin' buttons.

    • dir_listbox_width_increase
    • dir_listbox_width_reduce
    • fil_listbox_width_increase
    • fil_listbox_width_reduce
    • tall_win
    • short_win

    dirSelector_orEditListOfFavoriteDirs_ 1listbox.tk
    PROC NAMES:

    • edit_dirslist
    • loaddirs2listbox
    • put_vars
    • popup_msgVarWithScroll

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'IMAGEtools' procs :

  • sketch_onImgFromFile
    provides procedures activated by movements
    of the mouse cursor on a canvas.
    PROC NAMES:

    • get_img_filename
    • get_chars_before_last
    • doodle_start
    • doodle_continue
    • doodle_end
    • doodle_delete
    • image_grab
    • image_move
    • set_line_color1
    • set_background_color
    • update_colors_label
    • remove_all_lines
    • popup_msg_var
  • make_titleBlock_fontsANDimages
    provides procedures to put text and images
    on a canvas, located by movements of the
    mouse cursor on a canvas.
    PROC NAMES:

    • get_img_filename
    • get_chars_before_last
    • add_text_line
    • add_image
    • object_delete
    • object_move
    • set_text_color
    • set_background_color
    • set_font
    • update_colors_font_label
    • update_status_labels
    • clear
    • remove_all_lines
    • popup_msg_var_scroll
  • wheeeDiagram
    provides procedures to put ovals, rectangles,
    diamonds, lines, text and images on a canvas,
    located by movements of the mouse cursor
    on a canvas.
    PROC NAMES:

    • add_init_curve
    • add_points_to_curve
    • add_end_curve
    • add_init_diamond
    • add_drag_diamond
    • add_diamond
    • add_image
    • add_init_line
    • add_drag_line
    • add_line
    • add_init_oval
    • add_drag_oval
    • add_oval
    • add_init_polygon
    • add_drag_polygon
    • add_end_polygon
    • add_init_rect
    • add_drag_rect
    • add_end_rect
    • add_text_line
    • clear_canvas
    • delete_object
    • get_chars_before_last
    • get_img_filename
    • move_object
    • set_background_color
    • set_font
    • set_object_color1
    • set_object_color2
    • setup_opts-binds_for_objadd
    • update_colors_label
    • update_info_label
    • popup_msg_var_scroll
  • rotate_image_on2ndCanvas
    provides procedures to read an image file,
    put the image on a canvas, and
    rotate the image on a 2nd canvas.
    PROC NAMES:

    • get_img_filename
    • get_chars_before_last
    • make_imgID1_on_canvas1_init_imgID2
    • rotate_image
    • clear_canvases
    • set_background_color
    • update_color_button
    • popup_msgVarWithScroll
  • pointillateImage
    provides procedures to read an image file,
    put the image on a canvas, and put
    small squares or circles on the image ---
    uses a 'Browse...' button to
    startup a file-selector GUI.
    PROC NAMES:

    • get_img_filename
    • put_img_on_canvas
    • pointillate_img
    • popup_msgVarWithScroll
  • imageMagnets
    provides procedures to read an image file,
    put the image on a canvas, and then use
    mouse actions on the image to expand or
    contract circular areas on the image ---
    uses a 'Browse...' button to
    startup a file-selector GUI.
    PROC NAMES:

    • get_img_filename
    • get_chars_before_last
    • load_file_to_imgStructure
    • apply_magnet
    • popup_msgVarWithScroll
  • merge2images
    provides procedures to read two image files,
    put the images into in-memory Tk 'photo' image
    structures, and merge the 2 images into a
    sequence of intermediate images ---
    uses two 'Browse...' buttons to
    startup a file-selector GUI for each image ---
    uses a '(re)Merge' button to trigger the merge
    operation --- uses a 'makeAniGIF' button to make
    an animated-GIF file from the sequence of images.
    PROC NAMES:

    • get_img1_filename
    • get_img2_filename
    • get_chars_before_last
    • checkFile_convertToGIF
    • prep_imgsANDcanvas_forMerge
    • create_img1_photoID
    • create_img2_photoID
    • set_canvas_size
    • set_anchorPointOnCanvas
    • place_2images_onCanvas
    • set_merge_area_limits
    • merge2images
    • raise-lower_images
    • new_compass_point
    • set_background_color
    • update_color_button
    • popup_msgVarWithScroll
  • tkImageGridWarp_withFixedEdge
    provides procedures to read an image file,
    put the image into an in-memory Tk 'photo'
    image structure, put a grid on the image, and
    warp the image according to the way a user
    changes the grid --- uses a 'Browse...' button
    to startup a file-selector GUI for the image ---
    uses a 'Warp' button to trigger the warp operation
    --- uses a 'makeAniGIF' button to make an
    animated-GIF file from the sequence of images ---
    'bind' statements are used to implement the
    grid warping.
    PROC NAMES:

    • get_img_filename
    • get_chars_before_last
    • checkFile_convertToGIF
    • load_file_to_canvas
    • create_photoID0
    • create_photoID1
    • set_scrollregion_size
    • put_img1_on_canvas
    • initialize_grid_arrays
    • draw_grid1
    • move_pointSelect
    • move_point
    • move_pointEnd
    • delete_lines_at_ij
    • redraw_lines_at_ij
    • warp_at_moved-points
    • warp_inQuad
    • fill_grid1_triangle_with_corners
    • flash_orig_img
    • incr_nxsegs
    • decr_nxsegs
    • incr_nysegs
    • decr_nysegs
    • reload_grid
    • hide-show_grid_points
    • hide-show_grid_lines
    • popup_msgVarWithScroll
  • photoFileEDIT_viaFunctions
    contains a 'listbox' with scrollbars, to hold
    the EDIT-functions --- and contains one
    'entry' widget with a 'Browse...' button
    to fetch an image filename.
    PROC NAMES:

    (In the following, 'fim' is short for 'functional image')

    • get_img_filename
    • o   (the function-composition proc)
    • fim_put

      (Calls 'fim_make', below, to make the new image, in an image-holding instance, img2 say, then clears the canvas and puts the new image in img1, which is put on the canvas.

      So img1 holds the currently displayed image, and img2 holds the in-process image. This is essentially a 'double-buffering' technique.)

    • fim_make

      (Applies the selected (composite-)function to the pixels in img1, putting the result in img2.)

    • stop

      (Sets the STOPflag var to 1. That global var is checked in 'fim_make' at each row, and, if it is 1, 'fim_make' resets it to 0 and issues 'return'.)

    • loadfuncs2listbox

      (loads the listbox - for GUI initialization).

    • listboxSelectionTOentryString

      (to put a user-selected listbox line into the entry widget var, ENTRYfunc).

    About 20-plus 'transform'/'mapping' procs,
    with prefixes (indicating input and output)
    such as:

    • xyTOchex_

      (an xy point is mapped to a hex-color)

    • chexTOchex_

      (a hex-color is mapped to a hex-color)

    • xyTOxy_

      (an xy point is mapped to an xy point)

    • raTOxy_

      (a polar point is mapped to an xy point --- r,a = radius,angle)

    • dTOchex_

      (a decimal number (scalar) is mapped to a hex-color)

    • 0or1TOchex_

      (a one-digit number --- 0 or 1 --- is mapped to a hex-color)

    • fgxyTOchex_

      (2 funcs, f and g, evaluated at xy, map to a hex-color)

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'ImageCreators-Flat' procs :

  • draw_RECTANGLEwithROUNDEDcorners_ 2colors
    with 2 colors specifiable (for rectangle & background).
    PROC NAMES:

    • DrawRoundRect
    • set_color_inside
    • set_color_outside
  • draw_POLYGONSwithROUNDEDcorners_ 2colors
    with 2 colors specifiable (for polygon & background).
    PROC NAMES:

    • ReDraw
    • RoundPoly
    • RoundPoly2
    • rp
    • MakeStar
    • set_color_inside
    • set_color_outside
  • draw_SUPER-ELLIPSE_colorFilled
    with 2 colors specifiable (for super-ellipse & background).
    PROC NAMES:

    • ReDraw
    • set_ellipse_color
    • set_background_color
  • draw_SUPER-FORMULA-SHAPE_colorFilled
    with two colors specifiable via 2 buttons
    (for super-formula-shape & background).
    PROC NAMES:

    • ReDraw
    • set_scale_n3_to_n2_redraw
    • set_scale_b_to_a_redraw
    • set_shape_color1 (fill color)
    • set_shape_color2 (outline color)
    • set_background_color
  • More 'ImageCreators-Flat' scripts (and their procs) are to be shown here.

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'ImageCreators-Shaded3D' procs :

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'ImageAnimations' procs :

  • twoSinusoidalWavesMerging_twoPointSources
    PROC NAMES:

    • animate
    • setMappingVars_for_px2wc
    • Xpx2wc
    • Ypx2wc
    • set_scale_Ymax_equal_Xmax
    • set_max_color1
    • set_min_color2
    • set_zero_color0
    • update_color_button
    • reset_parms
    • advise_user
    • popup_msgVarWithScroll
  • tkBrownianMotionAnimation
    PROC NAMES:

    • animate
    • setMappingVars_for_px2wc
    • Xwc2px
    • Ywc2px
    • set_scale_Ymax_equal_Xmax
    • set_bkgd_color
    • set_line_color
    • update_color_button
    • reset_parms
    • clear_canvas
    • advise_user
    • popup_msgVarWithScroll
  • tkVisualizer_RadialLines
    PROC NAMES:

    • get_img_filename
    • add_image
    • animate
    • set_background_color
    • set_background_button_color
    • clear
    • advise_user
    • popup_msg_var_scroll

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'INTERNETtools' procs :

  • GetComics_viaHTTP
    (fetches comic images using the Tcl 'http' facility)
    PROC NAMES:

    • get_site_selectedInListbox
    • Retrieve
    • show_image_forPicURL
    • save_image_toLocalFile
    • date_increment
    • date_decrement
    • popup_msgVarWithScroll

    The following procs are called by the 'Retrieve' proc, depending on which site(/comic-strip) was selected from the listbox widget. (Some no longer work because the site changed.)

    • get_babyblues_comic
    • get_bizzaro_comic
    • get_dilbert_comic
    • get_doonesbury_comic
    • get_rhymeswithorange_comic
    • get_speedbump_comic
    • get_zits_comic

    The Tcl 'http' package routines

    • 'http::config'
    • 'http::geturl'
    • 'http::data'
    • 'http::cleanup'

    are used in the 'get_*_comic' procs and the 'show_image_forPicURL' proc.

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'MAPtools' procs :

  • To be populated.

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'MATHtools' procs :

  • tkAdsAdder
    (adds up times of TV commercials over an hour or so)
    PROC NAMES:

    • enterStartTime_fromScales
    • enterEndTime_fromScales
    • calcSEGlength_mmmss
    • clear_all
    • total_all_ads
    • Report
    • popup_msg_var_scroll
  • tkLendersCompoundInterestDreamCrushed_ eIsTheLimit
    PROC NAMES:

    • calc_interest
    • advise_user
    • popup_msgVarWithScroll

    When/if I implement plotting (on a canvas in the GUI), there will be procs like the following:

    • setMappingVars_for_px2wc
    • Xwc2px
    • Ywc2px
    • set_background_color
    • set_line_color
    • set_title-labels_color
    • set_ticmarks_color
    • update_button_colors
  • tkCompoundedGrowthCalculator
    PROC NAMES:

    • calculate
    • edit_inputs
    • decimal_check
    • advise_user
    • popup_msgVarWithScroll

    When I implement plotting (on a canvas in the GUI), there will be procs like the following:

    • setMappingVars_for_px2wc
    • Xwc2px
    • Ywc2px
    • set_background_color
    • set_line_color
    • set_title-labels_color
    • set_ticmarks_color
    • update_button_colors

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'MATHed' procs :

  • PrimesSieve_inResizableCanvas
    PROC NAMES:

    • load_primes_sieve_array
    • redraw_primes
    • set_color1
    • set_color2
    • update_colors_label
    • show_MxN_primes   (a text-file report)
    • popup_msgVarWithScroll
  • MathProof_thalesTheorem_ rightTriangles_ inSemiCircle
    PROC NAMES:

    • setMappingVars_for_px2wc
    • Xwc2px
    • Ywc2px
    • draw_line_x1y1x2y2
    • draw_arc_x1y1_degStart_degExtent
    • draw_text_x1y1_center
    • draw_pointOval_x1y1_radiusPx
    • Redraw
    • show-hide_proof
    • show_dotproduct
    • dotproduct_3points
    • set_draw_color
    • set_background_color
    • update_button_colors
    • popup_msgVarWithScroll
  • tkCircleCircumferenceByPolygons
    PROC NAMES:

    • setMappingVars_for_px2wc
    • set_MappingVars_forImageSquare
    • Xwc2px
    • Ywc2px
    • draw_circle
    • draw_inner_polygon
    • draw_outer_polygon
    • Redraw
    • set_bkgd_color
    • set_circle_color
    • set_inscribed_color
    • set_circumscribed_color
    • advise_user
    • popup_msgVarWithScroll
  • tkVarignonsTheorem
    PROC NAMES:

    • initDraw
    • pointSelect
    • pointMove
    • pointMoveEnd
    • redraw4movedA
    • redraw4movedB
    • redraw4movedC
    • redraw4movedD
    • show_state
    • set_background_color
    • set_line_color
    • set_point_color
    • update_button_colors
    • advise_user
    • popup_msgVarWithScroll
  • tkNapoleonsTheorem
    PROC NAMES:

    • initDraw
    • reset
    • pointSelect
    • pointMove
    • pointMoveEnd
    • redraw4movedA
    • redraw4movedB
    • redraw4movedC
    • show_state
    • area_triangle_3points
    • set_background_color
    • set_line_color
    • set_point_color
    • update_button_colors
    • advise_user
    • popup_msgVarWithScroll

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'ODEtools' procs :

  • tkSimulateSinglePendulumNoFriction
    PROC NAMES:

    • solve
    • runge-kutta-4
    • deriv
    • show_list
    • animate
    • setMappingVars_for_px2wc
    • Xwc2px
    • Ywc2px
    • set_pendulum_color1
    • set_background_color2
    • update_color_button
    • advise_user
    • reset_parms
    • edit_inputs
    • decimal_check
    • popup_msgVarWithScroll
  • tkSimulateBouncingBall
    PROC NAMES:

    • solve
    • runge-kutta-4
    • deriv
    • show_list
    • animate
    • setMappingVars_for_px2wc
    • Xwc2px
    • Ywc2px
    • set_ball_color1
    • set_background_color2
    • update_color_button
    • advise_user
    • reset_parms
    • edit_inputs
    • decimal_check
    • popup_msgVarWithScroll
  • tkSimulatePopulationGrowthLimit
    PROC NAMES:

    • solve
    • runge-kutta-4
    • deriv
    • show_list
    • plot
    • setMappingVars_for_px2wc
    • Xpx2wc
    • Ypx2wc
    • set_tic_interval
    • set_tics_list
    • set_plot_color1
    • set_background_color2
    • update_color_button
    • advise_user
    • reset_parms
    • edit_inputs
    • decimal_check
    • popup_msgVarWithScroll

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'PHYSICStools' procs :

  • tkAnimateCollisionOfTwoRigidMasses_1D
    PROC NAMES:

    • solve
    • animate
    • show_list
    • setMappingVars_for_px2wc
    • Xwc2px
    • Ywc2px
    • set_mass_color1
    • set_background_color2
    • update_color_button
    • advise_user
    • reset_parms
    • edit_inputs
    • decimal_check
    • popup_msgVarWithScroll
  • tkAnimateCollisionOfTwoStickingMasses_1D
    PROC NAMES:

    • solve
    • animate
    • show_list
    • setMappingVars_for_px2wc
    • Xwc2px
    • Ywc2px
    • set_mass_color1
    • set_background_color2
    • update_color_button
    • advise_user
    • reset_parms
    • edit_inputs
    • decimal_check
    • popup_msgVarWithScroll

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'PLOTtools' procs :

  • tkGnuplotXY_file2or3cols
    a 'frontend' for the 'gnuplot' command,
    to read data from a file and plot 1 or 2
    'curves' from 2 or 3 columns of data
    in the file
    PROC NAMES:

    • get_filename
    • view_file
    • replot
    • display_test_img
    • edit_inputs
    • getset_color
    • update_color_button
    • popup_msgVarWithScroll
  • tkGnuplotXY_logORloglog_ file2or3cols
    a 'frontend' for the 'gnuplot' command,
    to read data from a file and plot 1 or 2
    'log curves' from 2 or 3 columns of data
    in the file
    PROC NAMES:

    • get_filename
    • view_file
    • replot
    • display_test_img
    • edit_inputs
    • getset_color
    • update_color_button
    • popup_msgVarWithScroll
  • tkGnuplotXY_upto3mathExpressions
    a 'frontend' for the 'gnuplot' command,
    to plot up to 3 'curves' from
    up to 3 math expressions
    PROC NAMES:

    • listboxSelectionTOexprField
    • clear_expr
    • replot
    • display_test_img
    • edit_inputs
    • getset_color
    • update_color_button
    • popup_msgVarWithScroll
  • tkGnuplot3DsurfaceOr2Dcontour_ fromExprFxy
    a 'frontend' for the 'gnuplot' command,
    to plot a function f(x,y), a surface, with
    examples provided by a listbox on the GUI
    PROC NAMES:

    • listboxSelectionTOexprField
    • clear_expr
    • set_autoscale
    • replot
    • plot_surface
    • plot_contour
    • plot_heatmap
    • plot_surface-contour
    • plot_contour-heatmap
    • edit_inputs
    • display_test_img
    • show_palette_gradient
    • getset_color
    • update_color_button
    • set_overhead_view_angles
    • set_oblique_view_angles
    • popup_msgVarWithScroll
  • tkGnuplotXY_BarChart_fromFile
    a 'frontend' for the 'gnuplot' command,
    to plot a barchart from a data file,
    selecting 2 columns from the columns
    of data in the file
    PROC NAMES:

    • get_filename
    • view_file
    • replot
    • display_test_img
    • edit_inputs
    • getset_color
    • update_color_button
    • popup_msgVarWithScroll
  • PlotQuik_pie2D/PlotQuik_pie2D
    provides procs to plot a pie chart on a canvas
    using 'create arc' and 'create text' commands
    PROC NAMES:

    • update_plot   (the pie-chart maker)
    • itemSelect
    • itemMove
    • getset_bkgdcolor
    • resize_win
    • downsize_canvas
    • upsize_canvas
    • toggle_border
    • popup_msgVarWithScroll
  • Several more PlotQuik scripts (and their procs) may be added here.

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'SELECTOR(and-Converter)tools' procs :

  • A Simple, Non-obfuscated RGB Color Selector
    (RGB = Red-Green-Blue)
    PROC NAMES:

    • color_update
    • toggle_side
    • put_vars
    • popup_msgVarWithScroll

    The proc 'color_update' is called by the '-command' option on the 3 RGB 'scale' widgets.

  • A Font Selector
    PROC NAMES:

    • loadfams2listbox
    • show-select_cur_family_in_listbox
    • font_update
    • put_vars
    • getset_bkgdcolor
    • set_palette
    • downsize_win
    • upsize_win
  • ---- Some less-common selectors:

  • A Site Latitude-Longitude Selector
    (where 'sites' may be cities, countries,
    national parks, whatever)
    PROC NAMES:

    • listbox_select_siteID
    • put_vars
    • popup_msg_var_scroll
  • An Atom (and property) Selector
    (where the property may be atomic-weight,
    density, melting point, boiling point, etc.)
    PROC NAMES:

    • listbox_select_atomID
    • listbox_select_atomPROP
    • atom_props_list_update
    • put_vars
    • popup_msg_var_scroll
  • --- Some CONVERTER-Selectors:

  • tkAngleConvertSelect
    (convert among decimal-degrees, radians, percents)
    PROC NAMES:

    • angle_update
    • draw_circle
    • redraw_angle
    • put_vars
    • popup_msgVarWithScroll
  • tkDegreesMinSecConvertSelect
    (convert angle units between decimal-degrees
    and degrees-minutes-seconds)
    PROC NAMES:

    • angle_update
    • draw_circle
    • redraw_angle
    • put_vars
    • popup_msg_var_scroll
  • 'tkSpeedGun' (Velocity Convert-Select)
    (convert between kilometers/hr and miles/hr)
    PROC NAMES:

    • speed_update
    • put_vars
    • popup_msgVarWithScroll
  • tkTemperature Convert-Select
    (convert among Fahrenheit, Centigrade, Kelvin)
    PROC NAMES:

    • temperature_update
    • set_temperatureColor
    • get_centitext
    • put_vars
    • popup_msg_var_scroll
  • Several more CONVERTER-Selector scripts (and their procs) may be added here.

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'SYSTEMtools' procs :

  • Meters_forMemoryAndSwap_drawnTachStyle
    PROC NAMES:

    • make_tachometers
    • make_one_tachometer
    • draw_rivet
    • draw_circle_shadow
    • update_needles
    • update_one_needle
    • Refresh
    • popup_msgVarWithScroll
  • More SYSTEMtools scripts (and their procs) may be added here.

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'TEXTtools' procs :

  • The FE 'xpg' Text File Browse/Search GUI
    (with the unique and powerful
    'SAM' = 'Show All Matches' feature)
    (This GUI calls on several shell and Tcl-Tk scripts.
    See the description-and-code page for details.)
    PROC NAMES:

    • getfile2textwidget
    • search4string
    • all_matches2string
    • clear_search_string
    • selectchar2whitespace
    • getset_palette_color
    • set_text_colors
    • set_font
    • toggle_side
    • toggle_othropts
    • popup_msg
    • popup_msg_3opts
    • finalize_textwidget

    The proc 'getfile2textwidget' replaced 'readfile2textwidget' whose code is still available. The 'get' proc reads to line-feeds ; the read' proc reads block-by-block.

  • tkMovingText
    (animates given text on a Tk canvas
    --- horizontally or vertically)
    PROC NAMES:

    • show_hide_options
    • get_img_filename
    • add_image
    • set_font
    • get_text_lines_width_height
    • clear
    • direction_select
    • animate
    • set_text_color
    • set_background_color
    • update_color_button
    • advise_user
    • popup_msg_var_scroll

< Go to Table of Contents, above. >

< Go to Top of this page. >

Some Sources of
'VIDEOtools' procs :

  • tkBatchMediaFindPlay
    PROC NAMES:

    • get_filemask
    • check_for_criterion_change
    • findFiles_andCountListOrPlay
    • popup_msgVarWithScroll
  • More VIDEOtools scripts (and their procs) may be added here.

< Go to Table of Contents, above. >

< Go to Top of this page. >

Bottom of this page of
Tcl-Tk Code 'Snippets' -
Sources for Tcl-Tk 'PROCS'

--- a page of links to Tcl-Tk source code
--- mostly links to CODE pages
of the FE 'tkGooies' system.

To return to a previously visited web page, click on the Back button of your web browser a sufficient number of times. OR, use the History-list option of your web browser.
OR ...

< Go to Table of Contents, above. >

< Go to Top of Page, above. >

Page history:

Page was created 2016 Nov 04.
(Started with 3 categories - 3Dtools, IMAGEtools, and SELECTORtools. Just script-names, no proc-names.)

Page was changed 2016 Nov 07.
(Added proc-names under each script-identifying-name. Added some category names to the TableOfContents.)

Page was changed 2016 Nov 12.
(Added scripts-and-procs for most of the tkGooie categories. More AUDIOtools, MAPtools, SYSTEMtools, and VIDEOtools scriptlinks-and-procnames are to be added.)

Page was changed 2018 Aug 19.
(Added css and javascript to try to handle text-size for smartphones, esp. in portrait orientation.)

Page was changed 2019 Jun 18.
(Specified image widths in percents to size the images according to width of the browser window. Also some reformatting of the page was done.)