[Glade-users] gobject.TYPE_PYOBJECT in glade / gtkbuilder
Mats Taraldsvik
mats.taraldsvik at bickeringleague.net
Thu Jul 2 13:12:45 EDT 2009
Hi,
On Wed, 2009-06-24 at 16:15 -0400, Tristan Van Berkom wrote:
> On Wed, Jun 24, 2009 at 4:08 PM, Mats
> Taraldsvik<mats.taraldsvik at bickeringleague.net> wrote:
> [...]
> >
> > Do you mean creating a new liststore column (in treeview->edit...),
> > substituting "< define a new column >" with the string?
> >
> > I don't know exactly how to find the proper name, so I'm afraid you'll
> > have to elaborate for me to understand :)
>
> I mean:
> sed -e "s/GObject/PyObject/g" project.glade
>
> Ofcourse, you may not want to replace *ALL* your
> GObject strings with that, but look at the Glade file,
> look at the column definitions, and try changing
> the string that defines the column type (Glade will
> output the string "GObject" for object type columns).
>
> You need to change that for "PyObject", I think.
>
> Every type has a name in the GType system,
> returned by g_type_name(). Python has a type
> for its object, which isnt GObject, but nevertheless
> is a GType, you need to find its name.
It was PyObject. However, it looks like "unknown" data types is removed
when the file is saved.
Thus, on save, this snippet:
<object class="GtkListStore" id="showsStore">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
<!-- column-name backend -->
<column type="gchararray"/>
<!-- column-name data -->
<column type="PyObject"/>
</columns>
</object>
becomes :
<object class="GtkListStore" id="showsStore">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
<!-- column-name backend -->
<column type="gchararray"/>
<!-- column-name data -->
<column />
</columns>
</object>
Since adding a lot of these data types in glade by default would be
inconvenient ( the choose data type list would be huge ), perhaps these
could be added /enabled/disabled with plugins, somehow?
>
> Cheers,
> -Tristan
Mats
More information about the Glade-users
mailing list