Changeset 17 for trunk/gui/scripts/editor.tcl
- Timestamp:
- Jun 11, 2005 9:56:37 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/editor.tcl
r11 r17 91 91 [itcl::code $this _click %X %Y] 92 92 93 itk_component add emenu { 94 menu $itk_component(editor).menu -tearoff 0 95 } { 96 usual 97 ignore -tearoff 98 ignore -background -foreground 99 } 100 $itk_component(emenu) add command -label "Cut" -accelerator "^X" \ 101 -command [list event generate $itk_component(editor) <<Cut>>] 102 $itk_component(emenu) add command -label "Copy" -accelerator "^C" \ 103 -command [list event generate $itk_component(editor) <<Copy>>] 104 $itk_component(emenu) add command -label "Paste" -accelerator "^V" \ 105 -command [list event generate $itk_component(editor) <<Paste>>] 106 bind $itk_component(editor) <<PopupMenu>> { 107 tk_popup %W.menu %X %Y 108 } 109 93 110 eval itk_initialize $args 94 111 } … … 104 121 itcl::body Rappture::Editor::activate {} { 105 122 set e $itk_component(editor) 123 if {[winfo ismapped $e]} { 124 return ;# already mapped -- nothing to do 125 } 106 126 107 127 set info "" … … 234 254 if {[winfo containing $x $y] != $itk_component(editor)} { 235 255 deactivate 256 } else { 257 # make sure the editor has keyboard focus! 258 # it loses focus sometimes during cut/copy/paste operations 259 focus -force $itk_component(editor) 236 260 } 237 261 }
Note: See TracChangeset
for help on using the changeset viewer.