On Tue, 2003-02-04 at 02:00, Havoc Pennington wrote: > > So, probably it would be worthwhile to simplify the APIs and fix the cut > > & paste situation before writing the daemon. > > GtkClipboard in GTK 2.0 was an attempt to do this, and it does have > complete reference docs. I think you'll have to be more specific about > what is still too hard about > gtk_clipboard_set_text()/gtk_clipboard_wait_for_text(). Sure, that works fine for plaintext. But setting up cut & paste of other types is much more complicated, since you have to mess with the GtkTargets and GtkAtoms which are entirely non-trivial to use. > > Also, GTK should support basic cut & paste for its native widgets, like > > entry boxes. Making the implementation of the basic "Cut", "Copy" and > > "Paste" menu items trivial (and basically working out of the box for the > > stock widgets) should probably be a base requirement of the menu API > > that Owen mentioned on gtk-devel-list... > > You mean like gtk_editable_cut_clipboard(), > gtk_editable_copy_clipboard(), gtk_editable_paste_clipboard()? I didn't know about these ones. But it is still a fair amount of work to implement cut & paste menus for a window, because you have to hook up the menu item signals, check which widget has the focus, make sure that the cut/copy/paste items are appropriately made (in)sensitive (possibly checking the types in the clipboard), handle type conversions, etc. So, a 100% correct implementation is very complicated. Maybe there should be some kind of clipboard manager object that follows keyboard focus, updates the menu/toolbar items properly and routes the cut & paste requests to the right widgets automatically. I haven't put much thought into it but it's something that could make apps much easier to code. BTW, likewise, some kind of Undo API would be nice too. > Gluing it to the menu API so the global Edit menu works on widgets has > been discussed some. This is one of the (many) issues to hash out with > respect to the menu API. Cool. -- Ettore Perazzoli <ettore ximian com>
Attachment:
signature.asc
Description: This is a digitally signed message part