GNOME Bugzilla – Bug 158959
should keep names when copying
Last modified: 2004-12-22 21:47:04 UTC
From the original submitter: "If you copy something in glade, all the names of the objects making it up are reset to default names, which means you have to go through resetting them all for your code to work. Whilst this makes sense for cut-and-paste within a single window, if you cut-and-paste a whole window in the window list window, it is a real pain." While the toplevel widgets really need to have different names, as do the widgets inside a same window, two objects can share names being on different top-level windows. Thus, it does make sense to keep the names of the child widgets when copying/pasting. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=281934
We use the widget name as an ID in the XML file, so I think they must be unique. So I can't really change this. In future I think having one window per XML file will be the recommended usage, so the problem will be avoided.
Aren't they on different 'trees', though? This is probably enough namespace protection. Having one window per XML file and having glade handle that would be good, though.
From the XML spec: ============================================================================= Validity constraint: ID Values of type ID MUST match the Name production. A name MUST NOT appear more than once in an XML document as a value of this type; i.e., ID values MUST uniquely identify the elements which bear them. ============================================================================= All of the windows in a .glade file are in the same XML document so the IDs must be unique.