Re: GtkText
| From: | Scott Mattocks | Date: | Fri, 14 May 2004 12:16:11 +0000 |
| Subject: | Re: GtkText | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4484@lists.php.net to get a copy of this message | ||
Rhys Campbell wrote:
Trying to use GtkText boxes and write it value to a file but having some problems extracting it. Would anyone mind having a quick look?
function write_message()
{
$filename = 'C:\messages\test.txt';
$handle = fopen($filename, 'w'); // open \ create in write mode
fwrite($handle, $device_name); // write to file
fclose($handle); // close file when done
}
$button->connect('clicked', 'write_message'); // connect button click
// action to function
I am kind of new to php-gtk but it looks to me like you aren't passing the device name to the method when you connect it. I think you need to have $device_name be a parameter to your write_message function. You alos need to add it to your connect call.
function write_message($device_name) {
...
}
...
$button->connect('clicked', 'write_message', $device_name);
Scott Mattocks
P.S. Is there a reason the reply to address on these messages is not the list?