gnope php gtk gui gnope.org  

Exception?

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
beidlerj



Joined: 10 Feb 2006
Posts: 55
Location: Oregon, USA

PostPosted: Thu Sep 14, 2006 10:52 pm    Post subject: Exception? Reply with quote

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?
Back to top
scott



Joined: 16 Feb 2006
Posts: 35

PostPosted: Thu Sep 14, 2006 11:19 pm    Post subject: Reply with quote

I haven't tested it but this line from the release notes probably has something to do with it:
Quote:
Removed current working directory from the php.ini search path for CLI and readded it for other SAPIs (restore to pre 5.1.x behavior). (Edin)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.