<div dir="ltr">The code for the Activity is here:<div><br></div><div><a href="http://git.sugarlabs.org/myo-sugar-activities-examples/mainline/blobs/master/Add_Refinements_gtk3/ReadEtextsActivity2.py">http://git.sugarlabs.org/myo-sugar-activities-examples/mainline/blobs/master/Add_Refinements_gtk3/ReadEtextsActivity2.py</a><br>
</div><div><br></div><div>The code being executed is:</div><div><br></div><div><div>def edit_toolbar_copy_cb(self, button):</div><div>        textbuffer = self.textview.get_buffer()</div><div>        begin, end = textbuffer.get_selection_bounds()</div>
<div>        copy_text = textbuffer.get_text(begin, end,  False)</div><div>        self.clipboard.set_text(copy_text)</div></div><div><br></div><div>The definition for self.clipboard is:</div><div><br></div><div><pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(105,105,105);font-size:11px;line-height:12px;white-space:pre-wrap;word-wrap:break-word">
<span class="" style="color:rgb(0,0,0)">       self</span><span class="" style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(0,0,0)">clipboard </span><span class="" style="color:rgb(102,102,0)">=</span><span class="" style="color:rgb(0,0,0)"> </span><span class="" style="color:rgb(33,67,156)">Gtk</span><span class="" style="color:rgb(102,102,0)">.</span><span class="" style="color:rgb(33,67,156)">Clipboard</span><span class="" style="color:rgb(102,102,0)">()</span></pre>
<pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(105,105,105);font-size:11px;line-height:12px;white-space:pre-wrap;word-wrap:break-word"><span class="" style="color:rgb(102,102,0)"><br></span></pre>
<pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(105,105,105);font-size:11px;line-height:12px;white-space:pre-wrap;word-wrap:break-word"><span class="" style="color:rgb(102,102,0)">on line 166.</span></pre>
<pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(105,105,105);font-size:11px;line-height:12px;white-space:pre-wrap;word-wrap:break-word"><span class="" style="color:rgb(102,102,0)"><br></span></pre>
<pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(105,105,105);font-size:11px;line-height:12px;white-space:pre-wrap;word-wrap:break-word"><span class="" style="color:rgb(102,102,0)">This code is similar to what was in my Read Etexts Activity. I'll have to see if that one still works. I know textbuffer.get_text() used to take only two parameters and now needs three.</span></pre>
<pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(105,105,105);font-size:11px;line-height:12px;white-space:pre-wrap;word-wrap:break-word"><span class="" style="color:rgb(102,102,0)"><br></span></pre>
<pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(105,105,105);font-size:11px;line-height:12px;white-space:pre-wrap;word-wrap:break-word"><span class="" style="color:rgb(102,102,0)">But thanks for confirming that the clipboard works as I described. That means it's my problem and I can try and figure it out.</span></pre>
<pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(105,105,105);font-size:11px;line-height:12px;white-space:pre-wrap;word-wrap:break-word"><span class="" style="color:rgb(102,102,0)"><br></span></pre>
<pre class="" style="margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(105,105,105);font-size:11px;line-height:12px;white-space:pre-wrap;word-wrap:break-word"><span class="" style="color:rgb(102,102,0)">James Simmons</span></pre>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 14, 2014 at 6:40 PM, Walter Bender <span dir="ltr"><<a href="mailto:walter.bender@gmail.com" target="_blank">walter.bender@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Jan 14, 2014 at 6:20 PM, James Simmons <<a href="mailto:nicestep@gmail.com">nicestep@gmail.com</a>> wrote:<br>

> GCI has come and gone and none of my MYOSA tasks got done so I decided that<br>
> if I'm going to get a GCI T-shirt this year I'd better do something to earn<br>
> it. So I'm doing the tasks that I tried to get GCI-ers to do for me.<br>
><br>
> I'm really rusty at this, but I did manage to update the Gtk3 version of the<br>
> Adding Refinements example to use the current toolbar. However, when testing<br>
> it I discovered that copying text to the clipboard doesn't work the way I<br>
> remembered it. It seems to me that when I did the copy in the past there<br>
> would be an object in the frame that was the clipboard entry. You could have<br>
> several of these, and there was a menu option to make Journal entries out of<br>
> them. That's how I remember it, anyway.<br>
><br>
> I don't see this anymore, and I wonder if it is a change to Sugar itself or<br>
> just a bug in my code.<br>
<br>
</div></div>Hard to say without a link to your code :P<br>
<br>
You prob. want something like this:<br>
<br>
        clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)<br>
        text_buffer.copy_clipboard(clipboard)<br>
<br>
regards<br>
<br>
-walter<br>
<br>
><br>
> James Simmons<br>
><br>
><br>
> _______________________________________________<br>
> Sugar-devel mailing list<br>
> <a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
> <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Walter Bender<br>
Sugar Labs<br>
<a href="http://www.sugarlabs.org" target="_blank">http://www.sugarlabs.org</a><br>
</font></span></blockquote></div><br></div>