Re: GtkOptionMenu inside a GtkClist Cell:



Sean Holt wrote:

> Hello everybody,
>         I'm trying to put an option menu inside a clist cell. Seeing that I am
> mailing this list it's rather obvious that I can't figure it out for myself.
> *sighs*. Anybody out there have any info or suggestions on this?

Actually, you can't just put menu inside the cell, but you could "attach" it
there handling mouse button press events.

Set button_press hadler for area where you're packing CList.
In event structure you will have coordinates of mouse pointer, and widget where
the event occurs -> you should find out which cell is just under cursor.

gboolean clist_mouse_press  (GtkWidget *widget,
                             GdkEventButton *event,
                             CList *clist)
{
...
 GtkWidget *menu;
 if (event->button == 3 )
 {
    // I guess you would your row to be selected when pressed mouse over it,
    // right?
    res = gtk_clist_get_selection_info(clist, event->x, event->y, &row, &col);
    // well, there you have your cell
    // build pop-up menu, show it, make a choice -> reflect changes on your cell
 }
...
}

Enjoy,

-Andrew





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