Text Copy in HtmlWindow

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 41
Reputation: MaxVK is an unknown quantity at this point 
Solved Threads: 1
MaxVK MaxVK is offline Offline
Light Poster

Text Copy in HtmlWindow

 
0
  #1
Nov 27th, 2008
Hi. I have an HTML Control on my frame and I am able to display pages in it:

  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
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 41
Reputation: MaxVK is an unknown quantity at this point 
Solved Threads: 1
MaxVK MaxVK is offline Offline
Light Poster

Re: Text Copy in HtmlWindow

 
0
  #2
Nov 28th, 2008
Well, Iv had a little joy so far - Iv managed to get a click event recognised like this:
  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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 373 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC