basegui - combobox - dgw - drawcanvas - hyperhelp - sbuttonbar - seditor - sfilebrowser - sfinddialog - sqlview - statusbar - tablelist - tlistbox - tvmixins

dgw::statusbar 0.2

Detlef Groth, Schwielowsee, Germany

2020-04-14

NAME

dgw::statusbar - statusbar widget for Tk applications based on a ttk::label and a ttk::progressbar widget

Table of Contents

SYNOPSIS

package require dgw::statusbar
dgw::statusbar pathName options
pathName configure -textvariable varname
pathName configure -variable varname
pathName clear 
pathname progress value
pathName set message ?value?

DESCRIPTION

dgw::statusbar - is a composite widget consisiting of a ttk::label and a ttk::progressbar widget. It should be normally packaged at the bottom of an appöication. The text and the numerical progress value can be displayed either directly using the widget commands or via the -textvariable and -variable options which will be given at initialization time, but these options can be also redifined at a later point.

COMMAND

dgw::statusbar pathName ?options?

Creates and configures a new dgw::statusbar widget using the Tk window id pathName and the given options.

WIDGET OPTIONS

The dgw::statusbar widget is a composite widget where the options are delegated to the original widgets.

-maximum value

A floating point number specifying the maximum -value. Defaults to 100.

-textvariable varname

Delegates the variable varname to the ttk::label as such.

-variable varname

Delegates the variable varname to the ttk::progressbar. Note that the maximum value is 100. So you have to calculate the

WIDGET COMMANDS

Each dgw::combobox widgets supports its own as well via the pathName label cmd and pathName progressbar cmd syntax all the commands of its component widgets.

pathName clear message ?value?

Removes the message from the label and sets to progressbar to zero.

pathName label cmd ?option value ...?

Allows access to the commands of the embedded ttk::label widget. Via configure and cget you can as well configure this internal widget. For details on the available methods and options have a look at the ttk::label manual page.

pathName progress value

Sets the progressbar to the given value.

pathName progressbar cmd ?option value ...?

Allows access to the commands of the embedded ttk::progessbar widget. Via configure and cget you can as well configure this internal widget. For details on the available methods and options have a look at the ttk::progressbar manual page.

pathName set message ?value?

Displays the given message and value. If the value is not given it is set to zero.

EXAMPLE

package require dgw::progressbar
namespace import ::dgw::tlistbox
wm title . DGApp
pack [text .txt] -side top -fill both -expand yes
set stb [dgw::statusbar .stb]
pack $stb -side top -expand false -fill x
$stb progress 50
$stb set Connecting....
after 1000
$stb set "Connected, logging in..."
$stb progress 50
after 1000
$stb set "Login accepted..." 
$stb progress 75
after 1000
$stb set "Login done!" 90
after 1000
$stb set "Cleaning!" 95
after 1000
$stb set "" 100
set msg Sompleted
set val 90
$stb configure -textvariable msg
$stb configure -variable val

INSTALLATION

Installation is easy you can easily install and use this dgw::statusbar package if you have a working install of:

For installation you copy the complete dgw folder into a path of your auto_path list of Tcl or you append the auto_path list with the parent dir of the dgw directory. Alternatively you can install the package as a Tcl module by creating a file dgw/statusbar-0.2.tm in your Tcl module path. The latter in many cases can be achieved by using the --install option of statusbar.tcl. Try "tclsh statusbar.tcl --install" for this purpose.

DEMO

Example code for this package can be executed by running this file using the following command line:

$ wish statusbar.tcl --demo

The example code used for this demo can be seen in the terminal by using the following command line:

$ wish statusbar.tcl --code

DOCUMENTATION

The script contains embedded the documentation in Markdown format. To extract the documentation you should use the following command line:

$ tclsh statusbar.tcl --markdown

This will extract the embedded manual pages in standard Markdown format. You can as well use this markdown output directly to create html pages for the documentation by using the --html flag.

$ tclsh statusbar.tcl --html

This will directly create a HTML page statusbar.html which contains the formatted documentation. Github-Markdown can be extracted by using the --man switch:

$ tclsh statusbar.tcl --man

The output of this command can be used to feed a markdown processor for conversion into a man page, a html or a pdf document. If you have pandoc installed for instance, you could execute the following commands:

# man page
tclsh statusbar.tcl --man | pandoc -s -f markdown -t man - > statusbar.n
# html page
tclsh ../statusbar.tcl --man > statusbar.md
pandoc -i statusbar.md -s -o statusbar.html
# pdf
pandoc -i statusbar.md -s -o statusbar.tex
pdflatex statusbar.tex

SEE ALSO

TODO

AUTHOR

The statusbar widget was written by Detlef Groth, Schwielowsee, Germany.

COPYRIGHT

Copyright (c) 2019-2020 Dr. Detlef Groth, E-mail: detlef(at)dgroth(dot)de

LICENSE

dgw::statusbar package, version 0.2.

Copyright (c) 2019-2020 Dr. Detlef Groth, E-mail: detlef(at)dgroth(dot)de

This library is free software; you can use, modify, and redistribute it for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions.

This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.