X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 13 Aug 2013 05:26 AM by  anon
copy/paste from widget table
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
13 Aug 2013 05:26 AM
    hello, Is it possible to copy or paste data between a widget_table and the windows system clipboard? Specifically, I would like to copy numeric data from multiple cells of an IDL widget_table into an excel spreadsheet, or into another windows application. Is this possible? thanks, Mark

    Deleted User



    New Member


    Posts:81
    New Member


    --
    23 Dec 2013 10:51 PM
    Hi Mark, For IDL 8.3, you could do something like this: pro test_copy_cells_event, ev uname = widget_info(ev.id, /UNAME) if uname EQ 'copy' then begin widget_control, ev.top, get_uvalue=state widget_control, state.t, GET_VALUE=selection_value, $ /USE_TABLE_SELECT print, selection_value help, selection_value ; Format copied elements in each row as tab separated strings clipboard.set, strjoin(selection_value, string(9b)) print, 'clipboard set!' endif end pro test_copy_cells b = widget_base(/col, TITLE='Select cells then press "copy"...') t = widget_table(b, XSIZE=4, YSIZE=2, /EDITABLE) btn = widget_button(b, value='copy', uname='copy') widget_control, b, /realize widget_control, t, $ set_value=[['a','b','c','d'],['1','2','3','4']] state = {t:t} widget_control, b, set_uvalue=state xmanager, 'test_copy_cells', b end I hope this can help. Regards, Jim (Exelis VIS)
    You are not authorized to post a reply.