Re: clipboard

Emil Perhinschi wrote:


How can I send some text to the clipboard ?

Hi Emil,

gtk_editable_clipboard_text is not bound so you can't set it with
Gtk-Perl but I guess that it should be possible to add it to the
Gtk-Perl-0.7008/Gtk/xs/GtkEditable.xs with something like:

char *
clipboard_text (editable, newvalue=&PL_sv_undef)
    Gtk::Editable editable
    SV * newvalue

        RETVAL = editable->clipboard_text;
        if (items>1) {
                char * l = SvOK(newvalue) ? SvPV(newvalue, PL_na) : 0;
                editable->clipboard_text = l;

and then 'make install' again.

I am not very good with XS so this may be completely wrong but it is
supposed to return what is in the editable's clipboard if you call:
    print $form->{'text1'}->clipboard_text, "\n";

and also then reset it if you supply a value like:
    $form->{'text1'}->clipboard_text("NEW TEXT");

I don't know if this is any use or how you would use this in your app but
perhaps Lupus could advise.

Regards, Dermot

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]