Re: GtkCList - how to find which cell was clicked?
- From: Stephen Witkop <switk yahoo com>
- To: Oliver Elphick <olly lfix co uk>
- Cc: gtk-list gnome org
- Subject: Re: GtkCList - how to find which cell was clicked?
- Date: 17 Mar 2001 18:13:09 -0500
On 17 Mar 2001 20:13:50 +0100, Mark Roberts wrote:
> Dear Oliver!
>
> > I would like to have my application respond to a right-click in any
> > particular cell of a GtkCList by displaying further data about that cell's
> > contents. I am responding to a button-press event and seeing if it was the
> > right-button that was pressed.
> >
> > At present, I can't see how to discover which cell the mouse pointer is in
> > when the button-press event occurred.
>
> You are listening for clicks in the CList, right? If you place something
> in each cell that can itself create signals (almost anything: you probably
> have it in already, unless you're using only Labels in the CList), then
> you can attach a listener (the same listener) to each of those.
>
> I hope I'm right, good luck. It's certainly better than checking for the
> (x,y) position, isn't it?
>
> All the best, Mark
If you're already connecting to the button_press_event then you can use
gtk_clist_get_selection_info() with the x, y coordinates-(event->x,
event->y) to retrieve both the row and column that were clicked on. This
function is documented in the tutorial also.
Stephen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]