beidlerj
Joined: 10 Feb 2006 Posts: 55 Location: Oregon, USA
|
Posted: Thu Sep 14, 2006 10:52 pm Post subject: Exception? |
|
|
Hi,
When running my little program under PHP 5.2.0 RC4-dev, I get this:
| Code: |
PHP Fatal error: Uncaught exception 'PhpGtkGErrorException' with message 'Failed to open file 'ID.jpg': No such file or directory' in /Volumes/NO NAME/ALC GUI/myScrolledDialog.inc:21
Stack trace:
#0 /Volumes/NO NAME/ALC GUI/myScrolledDialog.inc(21): GtkWindow->set_icon_from_file('ID.jpg')
#1 /Volumes/NO NAME/ALC GUI/PhotoMGR.php(35): myScrolledDialog->__construct(Array)
#2 /Volumes/NO NAME/ALC GUI/PhotoMGR.php(30): selectFiles(Array)
#3 [internal function]: processFolder(Object(GtkFileChooserButton))
#4 /Volumes/NO NAME/ALC GUI/PhotoMGR.php(423): Gtk::main()
#5 {main}
thrown in /Volumes/NO NAME/ALC GUI/myScrolledDialog.inc on line 21
|
But when I run it under my older version of Gnope on my PC (PHP 5.1.x) it works just fine...
Here's the .inc file it's complaining about:
| Code: |
<?php
class myScrolledDialog extends GtkDialog
{
//ATTRIBUTES
private $scrollBox;
public $listBox, $checkButtons, $allButton, $noneButton;
const RESPONSE_SELECT_ALL = 2;
const RESPONSE_CLEAR_ALL = 3;
//CONSTRUCTOR
function __construct($files)
{
$this->scrollBox = new GtkScrolledWindow();
$this->scrollBox->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
$this->listBox = new GtkVBox();
$this->scrollBox->add_with_viewport($this->listBox);
parent::__construct("Select Files to Process");
//Create a new GtkDialog and set the title
$this->set_icon_from_file('ID.jpg');
$this->set_default_size(400,200);
$this->set_position(Gtk::WIN_POS_CENTER);
$this->set_skip_taskbar_hint(true);
$this->set_skip_pager_hint(true);
$this->set_keep_above(true);
$this->vbox->pack_start($this->scrollBox);
$this->allButton = new GtkButton("Select All");
$this->noneButton = new GtkButton("Clear All");
$this->action_area->pack_start($this->allButton);
$this->action_area->pack_start($this->noneButton);
$cancelButton = $this->add_button("gtk-cancel", Gtk::RESPONSE_CANCEL);
$okButton = $this->add_button("gtk-ok", Gtk::RESPONSE_OK);
$this->allButton->set_image(GtkImage::new_from_stock(Gtk::STOCK_APPLY, Gtk::ICON_SIZE_SMALL_TOOLBAR));
$this->noneButton->set_image(GtkImage::new_from_stock(Gtk::STOCK_MEDIA_STOP, Gtk::ICON_SIZE_SMALL_TOOLBAR));
$this->checkButtons = $this->createButtons($files);
//createButtons returns an array of GtkCheckButtons
$this->allButton->connect_simple('clicked', array($this, 'selectAll'));
$this->noneButton->connect_simple('clicked', array($this, 'clearAll'));
$this->connect_simple('destroy', array($this, 'destroy'));
}//End __construct()
//METHODS
private function createButtons($list)
{
$x = 0;
foreach ($list as $aFile)
{
$checkButtons[$x] = new GtkCheckButton("$aFile", false);
$this->listBox->pack_start($checkButtons[$x]);
$x++;
}
return $checkButtons;
}// END of createButtons()
public function selectAll()
{
foreach ($this->checkButtons as $aButton)
{
$aButton->set_active(true);
}
}// END of selectAll()
public function clearAll()
{
foreach ($this->checkButtons as $aButton)
{
$aButton->set_active(false);
}
}// END of clearAll()
}// END class myScrolledDialog
?>
|
Why does the code work under the older PHP, but not the newer? |
|