Hi, all, I'm trying to implement a copy to clipboard functionality, but have been unsuccessful. The app is mostly ripped from imageviewer.rb 'http://www.fxruby.org/doc/examples.html'. Can anyone show me how this is used. My code to this point is below. textbox = FXHorizontalFrame.new(splitter, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y, :padLeft => 0, :padRight => 0, :padTop => 0, :padBottom => 0) @textview = FXText.new(textbox, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y) copyBtn = FXButton.new(toolbar, "Copy\tCopy", copyicon, :opts => ICON_ABOVE_TEXT|BUTTON_TOOLBAR|FRAME_RAISED) def onCmdCopy(sender, sel, ptr) self.connect(SEL_CLIPBOARD_REQUEST) do setDNDData(FROM_CLIPBOARD, FXWindow.stringType, Fox.fxencodeStringData(@textview.to_s)) end end copyBtn.connect(SEL_COMMAND, method(:onCmdCopy)) Thanks, Kevin
on 2008-11-18 19:54
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.