943,758 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 554
  • Python RSS
Nov 27th, 2008
0

Text Copy in HtmlWindow

Expand Post »
Hi. I have an HTML Control on my frame and I am able to display pages in it:

Python Syntax (Toggle Plain Text)
  1. self.krtc = html.HtmlWindow(self, style=wx.NO_FULL_REPAINT_ON_RESIZE);
  2. self.krtc.LoadPage("apitest.html")

However, I'm having real problems trying to pick up a CTRL + C event (Or a right mouse click event) to copy any selected text.

Iv looked through the wxDemo, but I cant understand how the events work. Can anyone help please?

Regards

Max
Reputation Points: 10
Solved Threads: 1
Light Poster
MaxVK is offline Offline
46 posts
since Nov 2008
Nov 28th, 2008
0

Re: Text Copy in HtmlWindow

Well, Iv had a little joy so far - Iv managed to get a click event recognised like this:
python Syntax (Toggle Plain Text)
  1. self.Bind(html.EVT_HTML_CELL_CLICKED, self.krtc_OnClick, self.docMAIN)
  2.  
  3. ...
  4. ...
  5. ...
  6. def krtc_OnClick(self,event):
  7. x = self.krtc.SelectionToText()
  8. if x > "":
  9. print x

This works nicely, and could easily copy the selected text, but its not of much use unless the user knows that the text has been copied!

More to the point, Iv not been able to pick up any keyboard events yet, which rules out one of the most common methods of copying selected text!

Any ideas anyone?

regards

Max
Reputation Points: 10
Solved Threads: 1
Light Poster
MaxVK is offline Offline
46 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Help with finding out if a program exists in os path entries
Next Thread in Python Forum Timeline: Questions on How to Perform Certain Concepts





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC