Changeset 1414

Show
Ignore:
Timestamp:
06/24/08 16:38:14 (5 months ago)
Author:
rob
Message:

Refs #328: forces the fake middle mouse paste instead of using the X11 Primary Selection on version of before 2.8.8

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/peppy/stcbase.py

    r1399 r1414  
    1818# Mimic the primary selection middle mouse paste on non-X11 platforms, but 
    1919# unfortunately the primary selection will only be application local 
     20version = wx.version().split('.') 
     21version = int(version[0]) * 100 + int(version[1]) * 10 + int(version[2]) 
     22if wx.Platform == "__WXGTK__" and version > 287: 
     23    use_x11_primary_selection = True 
     24else: 
     25    use_x11_primary_selection = False 
    2026non_x11_primary_selection = None 
     27print "version=%d use=%s" % (version, use_x11_primary_selection) 
    2128 
    2229def GetClipboardText(primary_selection=False): 
     30    global use_x11_primary_selection 
    2331    global non_x11_primary_selection 
    2432 
    2533    success = False 
    2634    if primary_selection: 
    27         if wx.Platform == "__WXGTK__": 
     35        if use_x11_primary_selection: 
    2836            wx.TheClipboard.UsePrimarySelection(primary_selection) 
    2937        else: 
     
    4048 
    4149def SetClipboardText(txt, primary_selection=False): 
     50    global use_x11_primary_selection 
    4251    global non_x11_primary_selection 
    4352 
    4453    if primary_selection: 
    45         if wx.Platform == "__WXGTK__": 
     54        if use_x11_primary_selection: 
    4655            wx.TheClipboard.UsePrimarySelection(primary_selection) 
    4756        else: