PHP-GTK: GladeXML::get_widget() doesn't find some widgets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a Glade file with this widget:

        <child>
          <widget class="GtkTextView" id="errLog">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="editable">False</property>
            <property name="cursor_visible">False</property>
            <property name="accepts_tab">False</property>
          </widget>
          <packing>
            <property name="expand">True</property>
            <property name="fill">True</property>
            <property name="position">2</property>
          </packing>
        </child>

which is a child of a GtkVBox (errContainer), which is a child of a
GtkWindow (errWindow), and I want to write something into it:

function openErr($message) {
	logError($message);

	$window = glade()->get_widget('errWindow');
	$log = glade()->get_widget('errLog');

	$buf = new GtkTextBuffer();
	$buf->set_text(file_get_contents(LOG_FILE) or "Cannot read file ".LOG_FILE."!");

	$log->set_buffer($buf);
	$log->modify_font(new PangoFontDescription('Monospace'));

	$window->show_all();
}


But get_widget() doesn't find errLog: I get a Fatal Error and
var_dump($log) outputs null. errWindow gets found anyway, and if I
comment the two lines with $log->method() out, errWindow appears on the
screen too.

How can I get the object of errLog?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux