The gtk api provides it own status bar widget which could be used for embedded widget feedback but this it aimed at being used as part of a application's toplevel window.
A complex UI may have several component zone each of which giving its own feedback. This simpler messaging areas provided this capability by making feedback available by directly displaying the contents of global variables rather than pushing items onto a status message stack.
if 0 {
+-------------------------------------------------------------------------+
| msg0 | msg1 | msg2 | msg3 |
+-------------------------------------------------------------------------+
}
##
# Simple Tcl/Gnocl based message bar
# ref = unique ref (could be uapp or parent widget-id}
# itesm = list of extra field to be displayed in var val tooltip
# args = options to be passed to container
proc gnocl::messageBar { {ref myapp} {values { {A a Z} {B b Y} {C c X} }} args} {
set bar [gnocl::hBox {*}$args]
$bar add [gnocl::label \
-baseFont {Sans 9} \
-text msg0 \
-variable ${ref}(msg) ] -align left -expand 1
foreach item $values {
lassign $item i j k
set ::${ref}($i) $j
$bar add [gnocl::label \
-baseFont {Sans 9} \
-variable ${ref}($i) \
-widthChars 5 \
-align center \
-tooltip $k] -padding 10
}
return $bar
}
set container [gnocl::vBox]
set txt [gnocl::text -useMarkup 1]
$container add $txt -fill 1 -expand 1
$container add [gnocl::messageBar myapp [list {A a Z} {B b Y} {C c X} {D d W} {E e V} {F f}] -tooltip Messages] -align left
$txt verse 4
gnocl::window -child $container -width 500 -height 500
set myapp(msg) "Ok, ready to edit!"
parray myapp
Comments