Enums in Python

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Enums in Python

andreas.held
Hi

Sorry if this has been asked before, but I could not find anything in the archive.
In my C++ source code, which I am wrapping for Python, I have a normal enum declaration:
enum Fl_Color {
FL_WHITE = 255;
}

and I have several C style functions that return this enum, e.g.
Fl_Color get_color(uchar g) { return  (((g <<8 ) | g) << 8 |g);}

The problem is that the enum gets wrapped in those functions as an int ,
by means of SWIG_From_int. Is there a way I can tell SWIG to treat it as unsigned?

BTW, I am using swig-1.3.26

Thanks for your help.

Andreas Held
http://pyfltk.sourceforge.net




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user