Changeset 35 for trunk/gui/scripts
- Timestamp:
- Aug 10, 2005, 9:42:18 PM (19 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mainwin.tcl
r17 r35 22 22 -*-helvetica-bold-o-normal-*-*-140-* widgetDefault 23 23 24 # 25 # Tk text widget doesn't honor Ctrl-V by default. Get rid 26 # of the default binding so that Ctrl-V works for <<Paste>> 27 # as expected. 28 # 29 bind Text <Control-KeyPress-v> {} 30 31 # 32 # Fix the built-in <<Paste>> bindings to work properly even 33 # for the X11 windowing system. By default, Tk won't replace 34 # selected text in X11. What kind of stupid nonsense is that? 35 # 36 bind Entry <<Paste>> { 37 catch { 38 # always replace existing selection 39 catch { %W delete sel.first sel.last } 40 41 %W insert insert [::tk::GetSelection %W CLIPBOARD] 42 tk::EntrySeeInsert %W 43 } 44 } 45 proc ::tk_textPaste w { 46 global tcl_platform 47 if {![catch {::tk::GetSelection $w CLIPBOARD} sel]} { 48 if {[catch {$w cget -autoseparators} oldSeparator]} { 49 # in case we're using an older version of Tk 50 set oldSeparator 0 51 } 52 if { $oldSeparator } { 53 $w configure -autoseparators 0 54 $w edit separator 55 } 56 57 # always replace existing selection 58 catch { $w delete sel.first sel.last } 59 $w insert insert $sel 60 61 if { $oldSeparator } { 62 $w edit separator 63 $w configure -autoseparators 1 64 } 65 } 66 } 67 68 # ====================================================================== 24 69 itcl::class Rappture::MainWin { 25 70 inherit itk::Toplevel … … 102 147 set _sync(cutbuffer) "" 103 148 set _sync(selection) "" 104 syncCutBuffer ifneeded 149 150 global tcl_platform 151 if {$tcl_platform(platform) == "unix"} { 152 # this sync stuff only works for X windows 153 blt::cutbuffer set "" 154 syncCutBuffer ifneeded 155 } 105 156 } 106 157 -
trunk/gui/scripts/textentry.tcl
r22 r35 22 22 -*-helvetica-medium-r-normal-*-*-100-* widgetDefault 23 23 24 #25 # Tk text widget doesn't honor Ctrl-V by default. Get rid26 # of the default binding so that Ctrl-V works for <<Paste>>27 # as expected.28 #29 bind Text <Control-KeyPress-v> {}30 24 31 25 itcl::class Rappture::TextEntry {
Note: See TracChangeset
for help on using the changeset viewer.