Hi,
i have this piece of vala code that want work, when i compile it return this error:
“error: Assignment: Cannot convert from GLib.Object?
to Gdk.Monitor?
”,
how can i resolve this problem?
thanks
Gdk.Display display = Gdk.Display.get_default ();
GLib.ListModel monitors = display.get_monitors ();
uint n_monitors = monitors.get_n_items ();
stdout.printf(monitors.get_item_type ().name ()); //Return GdkMonitor
for (uint i = 0; i < n_monitors; i++) {
Gdk.Monitor monitor = monitors.get_item (i);
Gdk.Rectangle geometry = monitor.get_geometry ();
// ...........
}