Re: [Vala] C# developer, newbie question
- From: Andy Lees <andrewl oz gmail com>
- To: Wolfgang Mauer <wolfgang mauer kabelmail de>
- Cc: Vala-list <vala-list gnome org>
- Subject: Re: [Vala] C# developer, newbie question
- Date: Thu, 20 Dec 2018 08:51:22 +1100
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 returned string to create the associated enum value.
On Wed, Dec 19, 2018 at 10:28 PM Wolfgang Mauer <wolfgang mauer kabelmail de>
wrote:
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(strState).value;
What im doing wrong?
Thanks for help
Wolfgang
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]