Re: Defining custom GEnum subclasses




----- Original Message -----
> Hi,
> 
> I'm wondering if it is possible to define a new GEnum type.
> 
> GObject.type_register() only registers subtypes of GObject
> and whatever else I tried resulted in some error about a missing
> '__enum_values__' attribute (which I don't know how to define).
> 
> Of course this is expected, as I suppose that the underlying
> GObject system must be notified for the value list somehow.
> 
> I need the custom GEnum, to use it for defining custom properties.
> 
> 
> The reason why I DO NEED a custom GEnum instead of an integer
> for defining my properties, is that I want to expose and use
> my custom widgets from the Glade designer, and I want to
> be able to select the property by its values (with a combo box),
> instead of just specifying an integer
> 
> Thanks in advance,
> Costas
> 

Looking at the code in gobject/pygenum.c, it doesn't look like you can actually construct a GEnumClass in Python since it requires a subclass of GEnumClass that aleady defines the size and limits of the enum.  It is all pretty bound to C and there doesn't look like GEnums can ever be constructed dynamically.
  
--
John (J5) Palmieri
Software Engineer
Red Hat, Inc.


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