Re: [gtk-list] Re: CList titles are buttons?



>From: Jan Sochman <jena@artax.karlin.mff.cuni.cz>
>
>> Assuming that the GtkCList titles are actually buttons, how can I
>> attach a signal to them?  I looked in the CList source, and found
>> that each column has a button widget, but I'm still not clear on
>> how to address each title.
>
> It si signal "click_column" for clist. Then the signal function
> should look like this:
>
>  void signal_catch(GtkCList *cl, gint col)
>  {
>   ...
>  }
>
> where col is clicked column title :-).

I have a concern about this approach. In fact I had to do certain 
different things like sort the clist on a left-mouse click and pop-up a 
menu on right-mouse click. The "click_column" signal is only emitted on 
a left-mouse.

So, here is what I have done...

* Connect my own signal handlers to the column title buttons
   
   GTK_CLIST(clist)->column[i].button

   to the signal "event"

   It looks like the following:
   gtk_signal_connect(GTK_OBJECT(GTK_CLIST(clist)->column[i].button),
                "event",GTK_SIGNAL_FUNC(colSigHandler),(gpointer)i);
   ( 'i' is the column number )

* No within my signal handler colSigHandler() I will receive all the 
signals associated with that button, like all button-clicks, enter, 
leave etc and I can filter them to do whatever I like.

This approach works for me (a bit dirty though)

-kaq

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com



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