[Glade-users] objects properties in a custom catalog

Tristan Van Berkom tristan.van.berkom at gmail.com
Thu Aug 6 18:30:44 EDT 2009


On Thu, Aug 6, 2009 at 3:55 PM, Alexey
Kurochkin<alexey.kurochkin at pathfinderlwd.com> wrote:
> On Thu, 2009-08-06 at 14:16 -0400, Tristan Van Berkom wrote:
>> On Thu, Aug 6, 2009 at 1:15 PM, Alexey
>> Kurochkin<alexey.kurochkin at pathfinderlwd.com> wrote:
>> > I'm trying to create a catalog with my custom widgets and have couple of
>> > questions:
>> >
>> > 1. I have some objects which have a property called "name". Glade does
>> > not show that property, although it saves it. Is there a way to force
>> > the "name" property to be shown somewhere?
>>
>> Interesting, Glade handles "name" as a special case for GtkWidgets and
>> ties that into the widget id (and the parser equally treats this as a special
>> case).
>
> In my case these objects ain't GtkWidgets. They are simple GObjects.
>
[...]

>
> The "Name" entry (which is actually id) is there and works as expected.
> It's the actual "name" property I want to be able to edit independently.
>

[...]
> That's exactly what I do not want. That "name" property is used for
> different purpose by these objects, not unique and completely
> independent from id.

Ok, so if your names should not be unique you cant use the workaround
I suggested, sure.

As I said, the name not showing up for your object is bug, feel free
to file it.

I did not find the reason for the bug at a quick glance, I assure you
there is no deep reasoning for it not to work, just a special case that
needs to be tracked down probably in the plugin (from my pov, I
special case GtkWidget by disabling the name property explicitly).

Anyway, no point to bla bla bla about this, its just a bug.

>>
>> This would ofcourse only be satisfactory if its ok that your objects
>> all receive a unique "name" value; otherwise feel free to file a bug
>> about why we are not picking up the "name" property...
>
> I understand that it probably was not a good idea to name the property
> "name", but on the other hand I don't really get it why GtkWidgets are
> treated differently from any other GObject and their "name" property is
> being bounded to the id, when all other objects survive perfectly fine
> without even having that property. According to the docs the purpose of
> the "name" property is to apply certain style from gtkrc to the widget,
> which implies that it does not have to be unique, rather otherwise. Now
> GtkBuilder for no particular reason hijacks the property forcing it to
> be set to the unique id, completely defeating the purpose. I'm afraid
> this rather unfortunate bug has to be filed against gtk. Correct me if
> my logic is flawed.

I think it might work out of the box already, GtkBuilder applies the
id to all widgets
via GtkBuildable; GtkWidgets sync the id to the name property.

But that doesnt mean that this type of construct:

  <object class="GtkButton" id="ok_button">
     <property name="name">standard_button</property>
     ...

... would not be valid.

Glade never handled a separate name but if the above proves
to work theres no reason why we couldnt add a "theme name" property
or such to explicitly set the name.

Cheers,
           -Tristan


More information about the Glade-users mailing list