Thanks to David, Bill & Ric for their thoughts - below.

I've snipped the earlier history....

Here are some reactions;  this is all under Windows Vista 32:
a) David's clippaste.ijs helps - where should it go? Should
it go in ~addons/gui/gtk or ~user or somewhere else?  I used
.../gtk,  but realise it won't be pacmanaged.

b) setcliptext does what it says on the tin, so it doesn't
work on my boxed array; however, once I turn it into
a string,  the clipboard contents are available for
pasting into another application,  Excel in my case.

c) So we seem to have the following:
   wdclipwrite under J602 can be used for copying (and
pasting to other applications) from various J objects,
including boxed arrays;
   clipwrite under J701 does not appear to allow pasting
into other Windows applications;
   setcliptext does export to other apps,  but doesn't work
for boxed arrays.

d) It turns out that "require'gtk' " is fine if I start
jconsole.exe from the desktop or ~bin.   However, I was
trying to start it from a windows batch file,  and had
forgotten to include the argument " -js ".  Adding it
seems to remove the need for a relative pathname
such as " ~addons/gui/gtk/gtk.ijs ".    I looked for help
items on jconsole startup,  couldn't find any - I know
they're out there somewhere! - but resorted to using
the ~bin/xxx.bat files as paradigms.

Thanks again,

Mike

On 20/02/2011 19:00, David Mitchell wrote:
> I updated this version:
>
> http://www.jsoftware.com/jwiki/Scripts/WindowsClipboard
>
> I tried it in jconsole_7_32 and jconsole_7_64 and it seems to work fine.
>
> NB. cd replacement for wd'clippaste'
> NB.
> NB. wd'clippaste 1' ->  getcliptext''
> NB. wd'clippaste 2' ->  getclipfiles''
> NB. wd'clipcopy'    ->  setcliptext text
> NB.
> NB. getclip - gets text or file names from clipboard.
> NB. setclipfiles - puts one or more file names on clipboard.
> NB.
>
> On 2/20/2011 0:59, Ric Sherlock wrote:
>> Sorry I hadn't read the whole thread.
>>
>> You are right that if you call gtkinit then it works OK within the
>> jconsole session, however it is not present in the Windows clipboard,
>> so I can't paste the contents to another application.
>>
>> This works OK from Gtk IDE - I can clipwrite there and the result is
>> available for pasting to another application. Not sure how common that
>> such functionality would be used though (i.e. copy to clipboard from
>> jconsole and paste from clipboard to other application).
>>
>> On Sun, Feb 20, 2011 at 3:15 PM, bill lam<[email protected]>   wrote:
>>> I tested it ok running jconsole under wine. Did you forget to call gtkinit
>>> as suggested?  I did not test it on real window or kvm.
>>>
>>> Вск, 20 Фев 2011, Ric Tikkanz писал(а):
>>>> Had a look at this on Win7 32-bit
>>>>
>>>> Firstly ( require 'gtk' ) seems to work fine. If it is not working
>>>> check the contents of the noun Public_j_ which should contain an entry
>>>> linking "gtk" to "~addons/gui/gtk/gtk.ijs"
>>>>
>>>> In Gtk IDE clipwrite seems to work OK for me.
>>>> In jconsole I get the following when I attempt to clipwrite:
>>>> NB.======================================================
>>>> NB. Jconsole session
>>>>      JVERSION
>>>> Engine: j701/2011-01-10/11:25
>>>> Library: 7.01.045
>>>> Platform: Win 32
>>>> Installer: j701a_win.exe
>>>> InstallPath: c:/program files/j701
>>>>      require 'gtk'
>>>>      clipwrite i. 3 4
>>>>
>>>> (jconsole.exe:4044): Gtk-CRITICAL **: gtk_clipboard_get_for_display: 
>>>> assertion `
>>>> display != NULL' failed
>>>>
>>>> (jconsole.exe:4044): Gtk-CRITICAL **: gtk_clipboard_set_text: assertion 
>>>> `clipboa
>>>> rd != NULL' failed
>>>>
>>>> (jconsole.exe:4044): GLib-GObject-CRITICAL **: gtype.c:2710: You forgot to 
>>>> call
>>>> g_type_init()
>>>>
>>>> (jconsole.exe:4044): GLib-CRITICAL **: g_once_init_leave: assertion 
>>>> `initializat
>>>> ion_value != 0' failed
>>>>
>>>> (jconsole.exe:4044): Gtk-CRITICAL **: gtk_clipboard_store: assertion 
>>>> `GTK_IS_CLI
>>>> PBOARD (clipboard)' failed
>>>> 31
>>>>
>>>> NB. End Jconsole session
>>>> NB.====================================================
>>>>
>>>> At this stage the clipboard contents have not been changed.
>>>>
>>>> On Sun, Feb 20, 2011 at 1:39 PM, bill lam<[email protected]>   wrote:
>>>>> You may inspect source code for clipwrite.  If you had set up jtags, it 
>>>>> may
>>>>> located by placing cursor over the word 'clipwrite' and then press ctrl-]
>>>>> in gtkide. or type
>>>>> ta 'clipwrite'
>>>>> in jconsole.
>>>>>
>>>>> Сбт, 19 Фев 2011, Mike Day писал(а):
>>>>>> When running jconsole in J701 under Windows
>>>>>> Vista I find that require'gtk' doesn't work.
>>>>>>
>>>>>> It seems to need a fuller path,
>>>>>> require'~addons\gui\gtk\gtk.ijs'
>>>>>>
>>>>>> After fixing this,&   running jconsole from a Windows
>>>>>> batch file,  the clipboard appears to be empty after
>>>>>> calling clipwrite on a non-empty array.
>>>>>>
>>>>>> NB. eg clipping a boxed vector
>>>>>>       3{.OUT
>>>>>> +-------+-------+------+
>>>>>> |1200.00|1843.00|408.38|
>>>>>> +-------+-------+------+
>>>>>>       clipwrite OUT
>>>>>> 127
>>>>>>
>>>>>> NB. or a character string
>>>>>>        ":;".each 3{.OUT
>>>>>> 1200 1843 408.38
>>>>>>       clipwrite  ":;".each 3{.OUT
>>>>>> 16
>>>>>>
>>>>>> I have clipped these from the jconsole session,
>>>>>> but I can't of course clip the apparently empty
>>>>>> clipboard contents!
>>>>>>
>>>>>> Thanks for any help, and usual apologies for
>>>>>> missing the obvious,  my mistakes etc ....

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to