Re: managing selections




"Adrian E. Feiguin" <adrian@ifir.ifir.edu.ar> writes:

>  Hi, I'm working on a Sheet widget and I'd like it to be able to handle
> selections in the same way as gtkentry does. The problem is that my data
> is allocated in structures (say GtkSheetCell) and I don't know how to use
> the standard gtkselection with them. Can anybody tell me if it is
> possible, or I'd have to create an "special porpose" "gtksheetselection"
> selection handler?
>  Thank you in advance,

You'll want to look at the Selection part of the tutorial,
and examples/selection/.

These should give you some background on selections work,
and how to write a selection hander.

You will need a selection handler (unless your widget is derived
from GtkEditable, which doesn't seem appropriate) - but it won't
need to be too complicated, especially if you just want to
supply the selection for STRING. (gtkselection.c does all the
complicated parts for you)

If you want to support cutting and pasting of multiple cells between
different Sheet widgets, then you'll probably need to define your
selection type, (_GTK_SHEET_DATA or some such) and handle this as well
as STRING. Again, you would just need to supply the data in your
selection handler - GTK handles the Selection protocol for you.

Regards,
                                        Owen




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