[WJG] (18/05/13) The Gnocl widget set allows complex markup strings to be applied to label entries etc., through the use of the Pango markup language. This is useful but has can be meddlesome when long string are to be marked up. Pango recognizes the common HTML convenience tags and its easy to 'extend' this capability by adding custom alternatives. Before passing onto any markup-enabled widget strings can be mapped and expanded to the required settings. ====== #--------------- # test-markup.tcl #--------------- #!/bin/sh #\ exec tclsh "$0" "$@" package require Gnocl #--------------- # extend the range of convenience tags #--------------- # proc expand_tags {str} { set map { {} {} {} } return [string map $map $str ] } set str "Gnocl Text Markup\nExpanding Convenience Tags\nUsing String Mapping" puts "before: $str" puts "after [expand_tags $str]" set label [gnocl::label -text [expand_tags $str] ] gnocl::window \ -title "Label" \ -child $label \ -width 100 \ -height 25 ====== <> GUI