]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/wxTextCtrl.py
fix text scrolling in GTK2 (patch 703988)
[wxWidgets.git] / wxPython / demo / wxTextCtrl.py
index 1045efe3d0e23b0492b5a45eba2baf48fb816178..17d14e4c087bf6f626e3aedeeba1e90884f2afd9 100644 (file)
@@ -110,13 +110,25 @@ class TestPanel(wxPanel):
         text = self.tc.GetValue()
         if wxPlatform == "__WXMSW__":  # This is why GetStringSelection was added
             text = text.replace('\n', '\r\n')
         text = self.tc.GetValue()
         if wxPlatform == "__WXMSW__":  # This is why GetStringSelection was added
             text = text.replace('\n', '\r\n')
-        self.log.write("GetSelection(): (%d, %d)\n"
+        self.log.write("multi-line GetSelection(): (%d, %d)\n"
                        "\tGetStringSelection(): %s\n"
                        "\tSelectedText: %s\n" %
                        (start, end,
                         self.tc.GetStringSelection(),
                         repr(text[start:end])))
 
                        "\tGetStringSelection(): %s\n"
                        "\tSelectedText: %s\n" %
                        (start, end,
                         self.tc.GetStringSelection(),
                         repr(text[start:end])))
 
+        start, end = self.tc1.GetSelection()
+        text = self.tc1.GetValue()
+        if wxPlatform == "__WXMSW__":  # This is why GetStringSelection was added
+            text = text.replace('\n', '\r\n')
+        self.log.write("single-line GetSelection(): (%d, %d)\n"
+                       "\tGetStringSelection(): %s\n"
+                       "\tSelectedText: %s\n" %
+                       (start, end,
+                        self.tc1.GetStringSelection(),
+                        repr(text[start:end])))
+
+
     def OnT5LeftDown(self, evt):
         evt.Skip()
         wxCallAfter(self.LogT5Position, evt)
     def OnT5LeftDown(self, evt):
         evt.Skip()
         wxCallAfter(self.LogT5Position, evt)