Note that there are some explanatory texts on larger screens.

plurals
  1. POPython Glade could not create GladeXML Object
    primarykey
    data
    text
    <p>I've created a simple window GUI in Glade 3.6.7 and I am trying to import it into Python. Every time I try to do so I get the following error:</p> <pre><code>(queryrelevanceevaluation.py:8804): libglade-WARNING **: Expected &lt;glade-interface&gt;. Got &lt;interface&gt;. (queryrelevanceevaluation.py:8804): libglade-WARNING **: did not finish in PARSER_FINISH state Traceback (most recent call last): File "queryrelevanceevaluation.py", line 17, in &lt;module&gt; app = QueryRelevanceEvaluationApp() File "queryrelevanceevaluation.py", line 10, in __init__ self.widgets = gtk.glade.XML(gladefile) RuntimeError: could not create GladeXML object </code></pre> <p>My Python Code:</p> <pre><code>#!/usr/bin/env python import gtk import gtk.glade class QueryRelevanceEvaluationApp: def __init__(self): gladefile = "foo.glade" self.widgets = gtk.glade.XML(gladefile) dic = {"on_buttonGenerate_clicked" : self.on_buttonGenerate_clicked} self.widgets.signal_autoconnect(dic) def on_buttonGenerate_clicked(self, widget): print "You clicked the button" app = QueryRelevanceEvaluationApp() gtk.main() </code></pre> <p>And the foo.glade file:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;interface&gt; &lt;requires lib="gtk+" version="2.16"/&gt; &lt;!-- interface-naming-policy project-wide --&gt; &lt;object class="GtkWindow" id="windowRelevanceEvaluation"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="title" translatable="yes"&gt;Query Result Relevance Evaluation&lt;/property&gt; &lt;child&gt; &lt;object class="GtkVBox" id="vbox1"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="orientation"&gt;vertical&lt;/property&gt; &lt;child&gt; &lt;object class="GtkHBox" id="hbox2"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;child&gt; &lt;object class="GtkLabel" id="labelQuery"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="label" translatable="yes"&gt;Query:&lt;/property&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="expand"&gt;False&lt;/property&gt; &lt;property name="padding"&gt;4&lt;/property&gt; &lt;property name="position"&gt;0&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;child&gt; &lt;object class="GtkEntry" id="entry1"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="can_focus"&gt;True&lt;/property&gt; &lt;property name="invisible_char"&gt;&amp;#x25CF;&lt;/property&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="padding"&gt;4&lt;/property&gt; &lt;property name="position"&gt;1&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="position"&gt;0&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;child&gt; &lt;object class="GtkFrame" id="frameSource"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="label_xalign"&gt;0&lt;/property&gt; &lt;child&gt; &lt;object class="GtkAlignment" id="alignment1"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="left_padding"&gt;12&lt;/property&gt; &lt;child&gt; &lt;object class="GtkHButtonBox" id="hbuttonbox1"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;child&gt; &lt;object class="GtkRadioButton" id="radiobuttonGoogle"&gt; &lt;property name="label" translatable="yes"&gt;Google&lt;/property&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="can_focus"&gt;True&lt;/property&gt; &lt;property name="receives_default"&gt;False&lt;/property&gt; &lt;property name="active"&gt;True&lt;/property&gt; &lt;property name="draw_indicator"&gt;True&lt;/property&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="expand"&gt;False&lt;/property&gt; &lt;property name="fill"&gt;False&lt;/property&gt; &lt;property name="position"&gt;0&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;child&gt; &lt;object class="GtkRadioButton" id="radiobuttonBing"&gt; &lt;property name="label" translatable="yes"&gt;Bing&lt;/property&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="can_focus"&gt;True&lt;/property&gt; &lt;property name="receives_default"&gt;False&lt;/property&gt; &lt;property name="active"&gt;True&lt;/property&gt; &lt;property name="draw_indicator"&gt;True&lt;/property&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="expand"&gt;False&lt;/property&gt; &lt;property name="fill"&gt;False&lt;/property&gt; &lt;property name="position"&gt;1&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;child&gt; &lt;object class="GtkRadioButton" id="radiobuttonBoden"&gt; &lt;property name="label" translatable="yes"&gt;Boden&lt;/property&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="can_focus"&gt;True&lt;/property&gt; &lt;property name="receives_default"&gt;False&lt;/property&gt; &lt;property name="active"&gt;True&lt;/property&gt; &lt;property name="draw_indicator"&gt;True&lt;/property&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="expand"&gt;False&lt;/property&gt; &lt;property name="fill"&gt;False&lt;/property&gt; &lt;property name="position"&gt;2&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;child&gt; &lt;object class="GtkRadioButton" id="radiobuttonCSV"&gt; &lt;property name="label" translatable="yes"&gt;CSV&lt;/property&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="can_focus"&gt;True&lt;/property&gt; &lt;property name="receives_default"&gt;False&lt;/property&gt; &lt;property name="active"&gt;True&lt;/property&gt; &lt;property name="draw_indicator"&gt;True&lt;/property&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="expand"&gt;False&lt;/property&gt; &lt;property name="fill"&gt;False&lt;/property&gt; &lt;property name="position"&gt;3&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;/object&gt; &lt;/child&gt; &lt;/object&gt; &lt;/child&gt; &lt;child type="label"&gt; &lt;object class="GtkLabel" id="labelFrameSource"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="label" translatable="yes"&gt;&amp;lt;b&amp;gt;Source&amp;lt;/b&amp;gt;&lt;/property&gt; &lt;property name="use_markup"&gt;True&lt;/property&gt; &lt;/object&gt; &lt;/child&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="position"&gt;1&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;child&gt; &lt;object class="GtkFrame" id="frame1"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="label_xalign"&gt;0&lt;/property&gt; &lt;child&gt; &lt;object class="GtkHBox" id="hbox3"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;child&gt; &lt;object class="GtkLabel" id="labelResults"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="label" translatable="yes"&gt;Number Results:&lt;/property&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="expand"&gt;False&lt;/property&gt; &lt;property name="position"&gt;0&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;child&gt; &lt;object class="GtkSpinButton" id="spinbuttonResults"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="can_focus"&gt;True&lt;/property&gt; &lt;property name="invisible_char"&gt;&amp;#x25CF;&lt;/property&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="padding"&gt;4&lt;/property&gt; &lt;property name="position"&gt;1&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;/object&gt; &lt;/child&gt; &lt;child type="label"&gt; &lt;object class="GtkLabel" id="labelFrameResults"&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="label" translatable="yes"&gt;&amp;lt;b&amp;gt;Results&amp;lt;/b&amp;gt;&lt;/property&gt; &lt;property name="use_markup"&gt;True&lt;/property&gt; &lt;/object&gt; &lt;/child&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="padding"&gt;2&lt;/property&gt; &lt;property name="position"&gt;2&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;child&gt; &lt;object class="GtkButton" id="buttonGenerateResults"&gt; &lt;property name="label" translatable="yes"&gt;Generate!&lt;/property&gt; &lt;property name="visible"&gt;True&lt;/property&gt; &lt;property name="can_focus"&gt;True&lt;/property&gt; &lt;property name="receives_default"&gt;True&lt;/property&gt; &lt;/object&gt; &lt;packing&gt; &lt;property name="position"&gt;3&lt;/property&gt; &lt;/packing&gt; &lt;/child&gt; &lt;/object&gt; &lt;/child&gt; &lt;/object&gt; &lt;/interface&gt; </code></pre> <p>foo.glade and the above python script are in the same directory, and I have tried using a fully-qualified path but still get the same error (I am certain that the path is correct!).</p> <p>Any ideas?</p> <p>Cheers,</p> <p>Pete</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload