[GRASS-dev] Re: [GRASS GIS] #1472: wxgui layer manager output pane breaks PRIMARY X selection

GRASS GIS trac at osgeo.org
Mon Oct 17 16:23:22 EDT 2011


#1472: wxgui layer manager output pane breaks PRIMARY X selection
-------------------------+--------------------------------------------------
 Reporter:  marisn       |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  6.4.3                    
Component:  wxGUI        |     Version:  svn-trunk                
 Keywords:               |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by wenzeslaus):

 Both copyAndPaste.diff and copyAndPaste.2.diff (.2. may be better) will
 copy selected text to PRIMARY SELECTION clipboard. However both will
 discards contents of normal clipboard. So again it is reason to have it in
 settings. I'm not sure how it works on MS Win or Mac. I found code which
 may solve this platform things, see [http://www.java2s.com/Open-
 Source/Python/GUI/wxPython/wxPython-
 src-2.8.11.0/wxPython/wx/tools/Editra/src/util.py.htm this link]. But it
 also discards normal clipboard (same as my code).

 Here's the code:
 {{{
 text = self.GetSelectedText()
 data = wx.TextDataObject(text)
 clipboard = wx.TheClipboard
 clipboard.UsePrimarySelection()

 if clipboard.IsOpened() or clipboard.Open():
      clipboard.SetData(data)
      clipboard.Close()

 clipboard.UsePrimarySelection(False)
 }}}

 Maybe it could copy text to both clipboards. Replacing is better then
 discarding.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1472#comment:9>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list