Discussion:
[Gtk-sharp-list] Dual Monitor
truck0321
2014-12-09 00:04:52 UTC
Permalink
I am running windows and I'm looking for cross platform support of multiple
monitors. I'd like to open a Gtk window on a second monitor. The below
code returns the integer 0 no matter what monitor my Window resides on when
the code is run so it looks like it is not aware of a second monitor.

Gdk.Screen screen = this.Screen;
int mon = screen.GetMonitorAtWindow(this.ParentWindow);

Someone made the suggestion of setting the monitor through Gtk.Window.Screen
but this method does not exist in gtk-sharp-2.12.25. I am using Xamarin
Studio and my OS is Windows 7 x64.



--
View this message in context: http://mono.1490590.n4.nabble.com/Dual-Monitor-tp4664935.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
_______________________________________________
Gtk-sharp-list maillist - Gtk-sharp-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
Alexandre Faria
2014-12-09 16:27:22 UTC
Permalink
Hi,

I used this hack on Linux, it worked, I don't know if its going to be
useful for you, but it seems you had any help so far, so...

Gtk.Window _window = new Gtk.Window(WindowType.Toplevel);
window.Move(1280, 0);

The idea is just to create the window and then move it to the
coordinates of the second monitor.
I'm not sure how gtk on windows handles this.

I hope it helps,

Alexander
Post by truck0321
I am running windows and I'm looking for cross platform support of multiple
monitors. I'd like to open a Gtk window on a second monitor. The below
code returns the integer 0 no matter what monitor my Window resides on when
the code is run so it looks like it is not aware of a second monitor.
Gdk.Screen screen = this.Screen;
int mon = screen.GetMonitorAtWindow(this.ParentWindow);
Someone made the suggestion of setting the monitor through Gtk.Window.Screen
but this method does not exist in gtk-sharp-2.12.25. I am using Xamarin
Studio and my OS is Windows 7 x64.
--
View this message in context: http://mono.1490590.n4.nabble.com/Dual-Monitor-tp4664935.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
_______________________________________________
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
_______________________________________________
Gtk-sharp-list maillist - Gtk-sharp-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-
truck0321
2014-12-09 16:56:27 UTC
Permalink
That worked, thanks Alexandre. I added the below code to handle different
monitor resolutions.

Gdk.Rectangle mon = this.Display.GetScreen(0).GetMonitorGeometry(0);
this.Move (mon.Right, 0);





--
View this message in context: http://mono.1490590.n4.nabble.com/Dual-Monitor-tp4664935p4664953.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
_______________________________________________
Gtk-sharp-list maillist - Gtk-sharp-***@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
Alexandre Faria
2014-12-09 17:07:45 UTC
Permalink
Great!

Alexander
Post by truck0321
That worked, thanks Alexandre. I added the below code to handle different
monitor resolutions.
Gdk.Rectangle mon =
this.Display.GetScreen(0).GetMonitorGeometry(0);
this.Move (mon.Right, 0);
--
http://mono.1490590.n4.nabble.com/Dual-Monitor-tp4664935p4664953.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
_______________________________________________
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
Loading...