Cut/Copy/Paste in menu


I have a small program with a number of GtkEntry boxes and a
GtkTextView. I also have a GtkMenuBar with cut, copy and paste menu
items. I'm having trouble getting these working.

If I right-click any of the input fields I get a popup menu and the
cut/copy/paste options on it work fine. However, I'm not sure how to
link these to the menu bar buttons. I know the
gtk_text_buffer_paste_clipboard() commands exist, but I don't know how
to get the pointer to the widget the cursor is currently in. As far as I
know the MenuItem callback just supplies a pointer to the menu item
itself and not the actual text entry field? As I have multiple text
entries I can't hardcode a pointer to them.

Can anyone help? I'm been searching on the Internet for hours but
haven't found anything useful.

Many thanks

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]