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)
|