Discussion:
widgets with the same name in the same file?
(too old to reply)
Roland Koebler
2009-09-17 15:57:10 UTC
Permalink
Hi,

in Glade v3 it seems to be impossible to give two widgets the same
name, which was possible in Glade v2. Although it may sound strange
at first, it definitely is useful to have two widgets with the same
name in one file, e.g. for having several windows in 1 glade-file,
where each window has a "close_button" or a "number_entry".
I used this a lot with Glade v2.

So, could you again (like in Glade v2) allow several widgets with the
same name in one file?

(The alternative for the example above would either be much longer widget-
names (plus specific code for every window, since generic code may not work)
or a whole bunch of glade-files---which both seems clumsy.)


regards,
Roland

_______________________________________________
Glade-devel maillist - Glade-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-devel
Timo
2009-09-17 16:34:32 UTC
Permalink
It is possible. When you start Glade (or Edit=>Preferences), choose in
the preferences dialog for:
Object names are unique: inside toplevels

Instead of "Within the project".

Timo
Post by Roland Koebler
Hi,
in Glade v3 it seems to be impossible to give two widgets the same
name, which was possible in Glade v2. Although it may sound strange
at first, it definitely is useful to have two widgets with the same
name in one file, e.g. for having several windows in 1 glade-file,
where each window has a "close_button" or a "number_entry".
I used this a lot with Glade v2.
So, could you again (like in Glade v2) allow several widgets with the
same name in one file?
(The alternative for the example above would either be much longer widget-
names (plus specific code for every window, since generic code may not work)
or a whole bunch of glade-files---which both seems clumsy.)
regards,
Roland
_______________________________________________
http://lists.ximian.com/mailman/listinfo/glade-devel
_______________________________________________
Glade-devel maillist - Glade-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-devel
Andrea Zagli
2009-09-18 08:33:11 UTC
Permalink
Il giorno name="incorrect" class="incorrect">gio 17 set 2009 18:34:32
name="incorrect" class="incorrect">It name="incorrect"
class="incorrect">is name="incorrect" class="incorrect">possible.
name="incorrect" class="incorrect">When name="incorrect"
class="incorrect">you start name="incorrect" class="incorrect">Glade
(or name="incorrect" class="incorrect">Edit=>name="incorrect"
class="incorrect">Preferences), name="incorrect"
class="incorrect">choose in
name="incorrect" class="incorrect">the name="incorrect"
class="incorrect">preferences name="incorrect"
name="incorrect" class="incorrect">Object name="incorrect"
class="incorrect">names are name="incorrect"
class="incorrect">unique: name="incorrect" class="incorrect">inside
name="incorrect" class="incorrect">toplevels
name="incorrect" class="incorrect">Instead name="incorrect"
class="incorrect">of "name="incorrect" class="incorrect">Within
name="incorrect" class="incorrect">the name="incorrect"
class="incorrect">project".
name="incorrect" class="incorrect">but in name="incorrect"
class="incorrect">this case name="incorrect" class="incorrect">is
name="incorrect" class="incorrect">it possibile name="incorrect"
class="incorrect">to name="incorrect" class="incorrect">load,
name="incorrect" class="incorrect">with name="incorrect"
class="incorrect">gtkbuilder, name="incorrect" class="incorrect">for
name="incorrect" class="incorrect">example name="incorrect"
class="incorrect">two name="incorrect" class="incorrect">windows
name="incorrect" class="incorrect">with name="incorrect"
class="incorrect">inside a name="incorrect" class="incorrect">button
name="incorrect" class="incorrect">with name="incorrect"
class="incorrect">the name="incorrect" class="incorrect">same name?
and, when i use gtk_builder_get_object whichever name="incorrect"
class="incorrect">button name="incorrect" class="incorrect">gtkbuilder
returns?
Hi,
in name="incorrect" class="incorrect">Glade v3 name="incorrect"
class="incorrect">it seems name="incorrect" class="incorrect">to be
impossible name="incorrect" class="incorrect">to give
name="incorrect" class="incorrect">two widgets name="incorrect"
class="incorrect">the name="incorrect" class="incorrect">same
name, which was name="incorrect" class="incorrect">possible in
name="incorrect" class="incorrect">Glade v2. Although
name="incorrect" class="incorrect">it may sound strange
at first, name="incorrect" class="incorrect">it definitely
name="incorrect" class="incorrect">is useful name="incorrect"
class="incorrect">to have name="incorrect" class="incorrect">two
widgets name="incorrect" class="incorrect">with name="incorrect"
class="incorrect">the name="incorrect" class="incorrect">same
name in one file, e.g. name="incorrect" class="incorrect">for
having several name="incorrect" class="incorrect">windows in 1
glade-file,
where each window has a "close_button" or a "number_entry".
I used name="incorrect" class="incorrect">this a lot
name="incorrect" class="incorrect">with name="incorrect"
class="incorrect">Glade v2.
So, could name="incorrect" class="incorrect">you again (like in
name="incorrect" class="incorrect">Glade v2) allow several widgets
name="incorrect" class="incorrect">with name="incorrect"
class="incorrect">the
name="incorrect" class="incorrect">same name in one file?
(The alternative name="incorrect" class="incorrect">for
name="incorrect" class="incorrect">the name="incorrect"
class="incorrect">example above would either be much longer widget-
name="incorrect" class="incorrect">names (plus specific code
name="incorrect" class="incorrect">for every window, since generic
code may not work)
or a whole bunch name="incorrect" class="incorrect">of
glade-files---which both seems clumsy.)
_______________________________________________
Glade-devel maillist - Glade-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-devel
Roland Koebler
2014-04-03 08:08:05 UTC
Permalink
Hi,

unfortunately, I noticed that Glade 3.12.1 broke my old glade-files
*again*, since it forbids that widgets have the same name in a single
glade-file; this was possible in Glade 2, broke in Glade 3.4 (or
earlier), was possible again in a later Glade-version, and broke
again in Glade 3.12 (or earlier). Additionally, Glade silently renames
non-unique-widget-names, so that a simple load-and-save *breaks*
applications.

I filled a bug-report:
https://bugzilla.gnome.org/show_bug.cgi?id=727507

Can anybody tell me, why Glade constantly breaks this?

Even if it might sound strange, having widgets with the same names
-- as long as they are in different toplevels -- is *very* useful,
since it allows to have several toplevel-windows in the same gladefile,
with each toplevel-window e.g. having a "close_button", a "number_entry"
etc. The only current workaround I know, is to use a separate glade-file
for *every* toplevel-window, resulting in an unhandy, large number of
gladefiles. :((


Roland
Post by Timo
It is possible. When you start Glade (or Edit=>Preferences), choose
Object names are unique: inside toplevels
Instead of "Within the project".
Timo
Post by Roland Koebler
Hi,
in Glade v3 it seems to be impossible to give two widgets the same
name, which was possible in Glade v2. Although it may sound strange
at first, it definitely is useful to have two widgets with the same
name in one file, e.g. for having several windows in 1 glade-file,
where each window has a "close_button" or a "number_entry".
I used this a lot with Glade v2.
So, could you again (like in Glade v2) allow several widgets with the
same name in one file?
(The alternative for the example above would either be much longer widget-
names (plus specific code for every window, since generic code may not work)
or a whole bunch of glade-files---which both seems clumsy.)
regards,
Roland
_______________________________________________
Glade-devel maillist - Glade-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-devel

Loading...