Re: GtkCList -- determine which column is clicked
| From: | Arnd Vehling | Date: | Fri, 05 Sep 2003 11:22:43 +0000 |
| Subject: | Re: GtkCList -- determine which column is clicked | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3800@lists.php.net to get a copy of this message | ||
Hello,
Charles McLaughlin wrote:
I've built a two column GtkCList that I'd like to re-sort when the user clicks the column header. My list looks like this: First Name | Last Name ------------------------------------- I found the click_column signal -- but how can I tell which of the two columns were clicked?------- // Show which column has been clicked function clicked_column( $the_clist, $colno ) {
print "Column No. $colno has been pressed\n";} // Setup the clist $clist = &new GtkCList(3,array("Name","Last Name","E-Mail")); // Fill the clist which whatever u like // Connect event to the col labels $clist->connect( "click-column", "clicked_column" ); ------- If the rest of the code is ok the "clicked_column" function prints the numerical value of the "clicked column" :) 0 = First Col = Name, 1 = Sec Col = "Last Name", 2 = third col.= "E-Mail" etc. You can now use a switch statement to assign code depending on which of the col-labels has been pressed. I can send you a complete example if this isnt sufficient. NOTE: The function ommits the "user-data" argument. For more info look
at the according GTK+ 1.2 manual (not the gtk-php manual)best regards, Arnd