dgw::seditor - extended text editor widget with toolbar buttons, configurable syntax highlighting, window splitting facilities and right click popup menu for standard operations like cut, paste etc.


DDG 2020-03-14: dgw::seditor inherits from the standard Tk text editor widget all methods and options but has further a standard toolbar, a right click context menu and allows easy configuration for syntax highlighting either using options provided at widget creation or Ini-files. Scrollbars are as well added by default, they are only shown however if necessary. Furhter window splitting is added, the user can split the text editor window into two by pressing <Control-x> and thereafter either 2 or 3, splitting can be undone by pressing <Control-x> and thereafter the key 1.



Below an example where the *dgw::seditor* widget is configured at creation time with support for some markdown highlighting.

package require dgw::seditor
dgw::seditor .top -hilights {{md header ^#.+}    
                         {md comment ^>.+} 
                         {md keyword _{1,2}[^_]+_{1,2}}  
                         {md string {"[^"]+"}}}
pack .top -side top -fill both -expand true ;#"  
.top configure -filetypes {{Markdown Files}  {.md}}

# create a sample Markdown file and load it later
set out [open test.md w 0600] 
puts $out "# Header example\n"
puts $out "_keyword_ example\n"
puts $out "Some not hilighted text\n"
puts $out "> some markdown quote text\n"
puts $out "## Subheader\n"
puts $out "Some more standard text with two \"strings\" which are \"inside!\"" 
close $out
.top loadFile test.md


Below is an image of the running application.




Please discuss here ...

DDG 2020-03-14: Initial version of wiki page added.