Re: Unable to use enums that start with numbers



On Wed, Jul 6, 2016 at 9:13 AM,  <philip chimento gmail com> wrote:
On Tue, Jul 5, 2016 at 11:10 PM Christoph Reiter
<reiter christoph gmail com> wrote:

On Wed, Jul 6, 2016 at 7:50 AM,  <philip chimento gmail com> wrote:
However, it seems that PyGObject also automatically detects this
situation
and adds another alias, Gdk.EventType._2BUTTON_PRESS, as shown in the
Python
documentation for Gdk. [1] I assume it does something similar for your
enum
as well?

Sadly this is in the documentation only, I've filed
https://bugzilla.gnome.org/show_bug.cgi?id=768471


Are you sure? It worked for me...

getattr(Gdk.EventType, '2BUTTON_PRESS')
<enum GDK_2BUTTON_PRESS of type GdkEventType>
Gdk.EventType._2BUTTON_PRESS
<enum GDK_2BUTTON_PRESS of type GdkEventType>

Yeah, these are defined in the overrides:
https://git.gnome.org/browse/pygobject/tree/gi/overrides/Gdk.py#n178


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