GTK+ to multiple displays: use



Hi -

I was trying to adapt the GDK demo from "Multi-Head Support Overview", and was
getting a link unresolved on "gdk_display_new()".

The fix was to substitute "gdk_display_open()" instead:

  THIS CODE SUCCESSFULLY REDIRECTS TO SPECIFIED MONITOR:
  -----------------------------------------------------
GtkWidget *
create_drawing_area ()
{
  GdkDisplay *gdisplay;
  GtkWidget *window;
  GtkWidget *frame;
  GtkWidget *vbox;
  GtkWidget *da;
  GtkWidget *label;

  /* Create toplevel window */
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");

  /* Assign screen and display */
  gdisplay = gdk_display_open("unix:0.2");
  if (gdisplay) {
    GdkScreen *gscreen;
    gscreen = gdk_display_get_default_screen(gdisplay);
    if (gscreen) {
      gtk_window_set_screen(GTK_WINDOW(window), gscreen);
    }
    else {
      printf ("WARNING: Unable to get screen!\n");
  ...




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]