[wxruby-users] Filling clipboard doesn't work

Alex Fenton alex at pressure.to
Fri Aug 1 00:07:37 EDT 2008


Hi Niklas

Niklas Baumstark wrote:
> I ran into a bit of trouble with my first wxRuby application. I'm using
> ruby 1.8.6 with wxRuby 1.9.7 on x86 Linux (Ubuntu). Didn't test any
> other platform yet. In my application, I'm trying to access the
> clipboard like this:
>
> Wx::Clipboard.open do |clip|
>    clip.set_data Wx::TextDataObject.new("TEST")
>    clip.flush
> end
>
> This doesn't work. While running the app (after the execution of the
> above code), the menu entry "Paste" is enabled in other applications,
> but nothing is in the clipboard (at least nothing happens on pasting).
> After quitting my application, the menu entry is disabled again and the
> clipboard is empty.
>
> How do I access the clip properly?
>   

This code works fine for me on OS X; both while the app is running and 
after it's ended the text data is available to other apps via Paste, 
.I'll try it out on Ubuntu later.
> I still got another question: Is it possible to send key-messages to
> other apps using wxWidgets?
>   
Not as far as I know, sorry.

alex




More information about the wxruby-users mailing list