Skip to content

Commit

Permalink
add text_window_hl_text
Browse files Browse the repository at this point in the history
text color of selected/highlighted text in a [text define] window
  • Loading branch information
sebshader committed Dec 22, 2021
1 parent 81cfecf commit d975b43
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions doc/7.stuff/colors-plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# text_window_fill - [text] window background
# text_window_text - [text] window text
# text_window_highlight - like txt_highlight but for [text] window
# text_window_hl_text - color of highlighted text in [text] window
# text_window_cursor - [text] window cursor
# pdwindow_fill - background of post window
# pdwindow_fatal_text - text for fatal errors
Expand Down Expand Up @@ -72,6 +73,7 @@ atom_box_label "black"
atom_box_outline "cyan"
text_window_fill "black"
text_window_text "white"
text_window_hl_text "white"
text_window_highlight "green"
text_window_cursor "green"
pdwindow_fill "#000"
Expand Down
1 change: 1 addition & 0 deletions tcl/pd-gui.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ gop_box "#FF8080"
text_window_fill "#FFFFFF"
text_window_text "#000"
text_window_highlight ""
text_window_hl_text ""
text_window_cursor "#000"
pdwindow_fill "#FFFFFF"
pdwindow_fatal_text "#D00"
Expand Down
10 changes: 5 additions & 5 deletions tcl/pdtk_textwindow.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ proc pdtk_textwindow_open {name geometry title font} {
text $name.text -relief raised -highlightthickness 0 -bd 2 \
-font [get_font_for_size $font] \
-exportselection 1 -undo 1 \
-yscrollcommand "$name.scroll set" -background \
[::pdtk_canvas::get_color text_window_fill $name] \
-foreground [::pdtk_canvas::get_color text_window_text $name] \
-insertbackground \
[::pdtk_canvas::get_color text_window_cursor $name]
-yscrollcommand "$name.scroll set"

set tmpcol [::pdtk_canvas::get_color text_window_text $name]
if {$tmpcol ne ""} {
Expand All @@ -47,6 +43,10 @@ proc pdtk_textwindow_open {name geometry title font} {
if {$tmpcol ne ""} {
$name.text configure -selectbackground $tmpcol
}
set tmpcol [::pdtk_canvas::get_color text_window_hl_text $name]
if {$tmpcol ne ""} {
$name.text configure -selectforeground $tmpcol
}
scrollbar $name.scroll -command "$name.text yview"
pack $name.scroll -side right -fill y
pack $name.text -side left -fill both -expand 1
Expand Down

0 comments on commit d975b43

Please sign in to comment.