Re: Names in Glade XML files must be unique?




On Oct 11, 2004, at 9:54 PM, Daniel Kasak wrote:

I've just experienced some pretty weird behaviour when using Glade XML files. It seems that Gtk2::GladeXML's get_widget() will get hold of the *first* object if finds with the given name ( outside of it's "scope" ) instead of selecting the right one.

i think it actually gets the last one listed in the glade file.

Gtk2::GladeXML::get_widget() is a trivial binding for libglade's glade_xml_get_widget(), so whatever behavior you're seeing is coming from libglade, not the perl bindings.

libglade uses a GHashTable to hold the mapping of widget names to widgets; duplicate names will hash to the same table entry, and therefore the last-created widget will be the one found in the hash. does the MainMenu form come before or after the Batches window in your xml file?


Any plans to fix this behaviour?

nope; not our bug.  ;-)

--
Examples really shouldn't include unexploded ordnance.
  -- Joe Smith, referring to an example program i wrote.




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