Re: [Vala] C# developer, newbie question

2018-12-19 Thread Wolfgang Mauer
Thanks, but same result, does it work that way at all? GLib-GObject-CRITICAL **: 23:22:53.584: g_enum_get_value_by_name: assertion 'G_IS_ENUM_CLASS (enum_class)' failed EnumClass enumc = (EnumClass)typeof(Gdk.WindowState).class_ref (); var state = (Gdk.WindowState)enumc.get_value_by_name("FOCU

Re: [Vala] C# developer, newbie question

2018-12-19 Thread Andy Lees via vala-list
I believe it's because the string produced in your first assignment to strState is the C transformed enum value which concatenates the type and value with an "_". It does this to map the nested name space of Vala enums into the flat C name space. You would need to remove the type + "_" from the r

Re: [Vala] C# developer, newbie question

2018-12-19 Thread Wolfgang Mauer
Hi all, i try to put a enum to string and back, with no success. var strState = get_window().get_state().to_string(); <-- "GDK_WINDOW_STATE_FOCUSED" and back dont work EnumClass enumc = (EnumClass)typeof(Gdk.WindowState).class_ref (); var state = (Gdk.WindowState)enumc.get_value_by_name(strSt

Re: [Vala] C# developer, newbie question

2018-12-19 Thread Wolfgang Mauer
Hi all, i try to put a enum to string and back, with no success. var strState = get_window().get_state().to_string(); <-- "GDK_WINDOW_STATE_FOCUSED" and back dont work EnumClass enumc = (EnumClass)typeof(Gdk.WindowState).class_ref (); var state = (Gdk.WindowState)enumc.get_value_by_name(strSt