Re: Clist Question

From: Date: Mon, 09 Sep 2002 04:12:10 +0000
Subject: Re: Clist Question
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-2406@lists.php.net to get a copy of this message
On Fri, Sep 06, 2002 at 12:25:13PM -0600, Scott Weeks wrote: > I was wondering how to accomplish a little task. I currently have a clist > whose data is coming from a mysql database. I want to be able to double > click a record, have a new window spawn with the appropiate data in a form, > and then update information that was change in the form to the clist when I > hit an okay button. How would I do this? Basically how do I check for the > double click, and how do I pass the information from the select clist record > to the new window? Create the new window with an associated data pointer that points to an array or something that contains the data as read from the database. When the okay button is hit, read the associated data pointer, and form an SQL UPDATE command based on the data in the array and the form data entry fields. Or, at worst, maintain a global array of spawned windows, and index into that array when you need to have the code figure out what to do. Double click is detected by checking the values in the GDK event structure that is passed to a button press event callback handler for the GtkCList. Check the event type for GDK_2BUTTON_PRESS. That indicates that the list encountered a double-click. -- James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/

« previous php.gtk.general (#2406) next »