aboutsummaryrefslogtreecommitdiff
path: root/pdwindow_popup_mode-plugin.tcl
blob: fd1c296daf8a5d455f375c38984af01428867ae8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# create an option for a mode where the Pd window pops up whenever anything is
# printed to the text box in the Pd window

set ::pdwindow::popupmode 0
rename pdtk_post pdtk_post_original
proc pdtk_post {message} {
    if {$::pdwindow::popupmode} {
        wm deiconify .pdwindow
        raise .pdwindow
    }
    pdtk_post_original $message
}

set mymenu .menubar.window
set inserthere [$mymenu index [_ "Parent Window"]]
$mymenu insert $inserthere separator
$mymenu insert $inserthere check -label [_ " Popup mode"] -variable ::pdwindow::popupmode