Strange ... GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed ....

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Strange ... GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed ....

AngeloP
Have you an Idea where the code is wrong ??? The code is not a clean code at this moment ..

I've posted the code here http://pastebin.com/m2943e1b0 go to see it or download here class_controlli.phpw

What make this code

I want to make a simple way to build forms with controls on fields
the class One_label_One_entry help me to have a widget with one label and one entry
I want to setup justification height and with in a simple way.
After
I want to check if a field is required ( on blur you get red color for required fields )
I want to make some field read only ( grey fields )
I want to set a default value or entry mask etc..

I want to navigate the form with return key and so on

I use an array, in this array I put in the sequence of the nextfield to navigate form by enter key,
and the entry objects and the clas objects

$objs[0][nextfield]=number of the nextfield to go ( in array)
$objs[0][obj]=entry object ( to setup speedy the color lenght etc.. )
$objs[0][this]=the istance of class  One_label_One_entry

If you run the code code you can get some error like this (here at the bottom) when you close the window

BUT if you complete the form when you close window you have no more errors

I think the problems rise where I setup the require fields

see the code in class

...

 function OnRequired($entry)
        {
              $text=$entry->get_text();
             
              $test=eregi_replace("0|\,|\.","",$text);


              if(empty($test)  )
              {
                 
                  $entry->grab_focus();
                  $entry->modify_base(Gtk::STATE_NORMAL, GdkColor::parse('#FF0000'));
                 
                  $err_msg="E' richiesto un valore !!! ";
                  gdk::beep();
              }else{
                 
                  $entry->modify_base(Gtk::STATE_NORMAL, GdkColor::parse('#FFFFFF'));
                  $err_msg="";
              }
           
        return $err_msg;
        } // Fine required
       

....

(php.exe:4244): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed
(php.exe:4244): GLib-GObject-WARNING **: invalid unclassed pointer in cast to `GObject'
(php.exe:4244): GLib-GObject-CRITICAL **: g_object_freeze_notify: assertion `G_IS_OBJECT (object)' failed
etc...