On Tue, Mar 22, 2016 at 2:36 PM, Wildman via Python-list
wrote:
> Thanks. I changed the code as you (and MRAB) suggested.
>
> def copy_clipboard(self):
> try:
> text2copy = self.text.get(tk.SEL_FIRST, tk.SEL_LAST)
> except tk.TclError:
> text2copy = self.text.get()
> r
On Tue, 22 Mar 2016 12:47:11 +1100, Chris Angelico wrote:
> On Tue, Mar 22, 2016 at 12:24 PM, Wildman via Python-list
> wrote:
>> I have a gui that has text widget and I want to be able to
>> copy to the clipboard the text that is highlighted or the
>> text widget's entire contents if no text is
On Tue, 22 Mar 2016 02:01:53 +, MRAB wrote:
> On 2016-03-22 01:47, Chris Angelico wrote:
>> On Tue, Mar 22, 2016 at 12:24 PM, Wildman via Python-list
>> wrote:
>>> I have a gui that has text widget and I want to be able to
>>> copy to the clipboard the text that is highlighted or the
>>> text
On 2016-03-22 01:47, Chris Angelico wrote:
On Tue, Mar 22, 2016 at 12:24 PM, Wildman via Python-list
wrote:
I have a gui that has text widget and I want to be able to
copy to the clipboard the text that is highlighted or the
text widget's entire contents if no text is highlighted.
Fortunately
On Tue, Mar 22, 2016 at 12:24 PM, Wildman via Python-list
wrote:
> I have a gui that has text widget and I want to be able to
> copy to the clipboard the text that is highlighted or the
> text widget's entire contents if no text is highlighted.
Fortunately your code reveals that you're using "tk"
I have a gui that has text widget and I want to be able to
copy to the clipboard the text that is highlighted or the
text widget's entire contents if no text is highlighted.
This line of code works for the highlighted text:
text2copy = self.text.get(tk.SEL_FIRST, tk.SEL_LAST)
However, this co