activebackground background borderwidth cursor exportselection foreground highlightcolor highlightthickness relief selectbackground selectborderwidth selectforeground
See the options manual entry for details on the standard options.
activerelief dblclickcommand disabledforeground elementborderwidth height hscrollmode jump labelbitmap labelfont labelimage labelmargin labelpos labeltext labelvariable sbwidth scrollmargin selectioncommand selectmode state textbackground textfont troughcolor visibleitems vscrollmode width
See the scrolledlistbox manual entry.
Name: datacmd Class: Datacmd Command-Line Switch: -datacmd
-datacmd {SQL {select * from dc_runrule}}The hubtable is designed to be used with either the -datacmd option specified, or the -subscription option specified. The -datacmd option is used when the displayed data is to be static or manually refreshed. Typically when using the -datacmd option, the bind command is used to have <F5> invoke pathName refresh.
Name: rhs_cols Class: Rhs_cols Command-Line Switch: -rhs_cols
Name: sortkeys Class: Sortkeys Command-Line Switch: -sortkeys
[index type]+ [{ascending | descending}]where index is the list element index into the data row(s), and type is one of the literal terms ascii, int, or real to indicate what kind of data comparison is appropriate. For example:
pathName configure -sortkeys {{2 real} {0 ascii} {1 ascii} ascending}
Warning - if you redefine the sorting, and you are using -subscription the subscription notifications may not work correctly unless all of the table keys are included in the sort.
Name: subscription Class: Subscription Command-Line Switch: -subscription
table [column_list [where_clause]]where column_list is an optional list of column names, and where_clause is an optional clause to specify a selection condition. If the where_clause is specified, it should start with the SQL keyword where and include the boolean conditions that normally follow the where keyword in an SQL selection statement. For example:
pathName configure -subscription {dc_item_use * {where spc_alarm<>0}}
The hubtable command creates a widget that displays table data, and a new Tcl command whose name is pathname. The command is then used to invoke various methods of the widget. The command has the general form:
pathName option ?arg arg ... arg?
One of the -datacmd or -subscription options is used to specify the data to be displayed. If you use the -datacmd, you may want to bind <F5> to the refresh action.
The -width and -height options are in terms of overall pixels. You probably want to use -visibleitems to specify a ColumnsxRows value used to set the size of the table display.
You should only specify a fixed pitch font for the data.
bind [$hubtab bindtag] <Button-3> "tk_popup $my_menu %X %Y"
package require dmh dmh_import package require Dmhwidgets SQL "create table dc_runrules (name varchar(10),description \ varchar(80),primary key(name))" SQL "insert into dc_runrules (name,description) values ('1sigma',\ 'Western Electric #3 - 4 of 5 points above +1 sigma or below -1 sigma')" SQL "insert into dc_runrules (name,description) values ('1sigmaH',\ '4 of 5 points higher than +1 sigma')" SQL "insert into dc_runrules (name,description) values ('1sigmaL',\ '4 of 5 points lower than -1 sigma')" SQL "insert into dc_runrules (name,description) values ('2sigma',\ 'Western Electric #2 - 2 of 3 points above +2 sigma or below -2 sigma')" dmhwidgets::hubtable .hubtable -subscription dc_runrules -visibleitems 40x10\ -labelfont {Helvetica 12 bold} -labelpos nw -labeltext "Table dc_runrules" pack .hubtable -side top -expand 1 -fill both bind [.hubtable bindtag] <Button-3> "puts {rt-click action}"