[MacOSX]Cut, Copy, and Paste in the registers

Charles Day cedayiv at gmail.com
Mon Aug 3 19:41:37 EDT 2009


On Mon, Aug 3, 2009 at 11:51 AM, John Ralls <jralls at ceridwen.us> wrote:

>
> On Aug 3, 2009, at 7:55 AM, Derek Atkins wrote:
>
>  Hi,
>>
>> John Ralls <jralls at ceridwen.us> writes:
>>
>>  I've figured out why this doesn't work: The register module (and
>>> perhaps a couple of others, I haven't looked) implements Cut, Copy,
>>> and Paste via gtkselections.c, which in turn depends upon
>>> gdkselection(-quartz).c. Unfortunately, gdkselection is an ICCCM
>>> (i.e., X-Windows) specific protocol. It might be possible to implement
>>> in Cocoa, but it would be a lot of work.
>>>
>>> It seems to me to be completely unnecessary for registers, where all
>>> of the data are strings. Is there any good reason not to rewrite the
>>> cut, copy, and paste functions to simply work the same as the main
>>> window ones? (If they go away along with the menu-stuffing and
>>> callbacks, will the gnc-main-window versions just magically take
>>> over?)
>>>
>>
>> IIRC (I may be mistaken) the register cut/copy/paste does full
>> transaction copying...  But I might be misremembering.
>>
>>
> Derek,
>
> No, it doesn't seem to. One can't even select a whole transaction that way,
> which I guess is why the Transaction menu has its own cut/copy/paste
> functions (which work fine under Quartz, by the way).
>

I think John is correct about split and transaction cut/copy/paste. As I
recall, the menu item for copying a transaction calls a function in
ledger-core/split-register.c that does its copy via a Scheme routine. The
"clipboard" if you will is a Scheme object that is tracked in a static
variable defined in the same C file. Same thing for splits. I don't think
gtk is involved.


> Gtk_selection_* is used only in
> src/register/register-gnome/gnucash-item-edit.c, and appears to be used only
> for operating on a single element in a transaction or split.
>
> Regards,
> John Ralls


-Charles


More information about the gnucash-devel mailing list