title: How to get XID of Gtk2 GtkDrawingArea to embed Mplayer
body: <p>I'm writing a Gtk2 application that among other things needs to have <code>Mplayer</code> play a video into a<code>GtkDrawingArea</code>. From what I can tell, this is possible if one can find the XID of the<code>GtkDrawingArea</code> and pass this as a parameter to Mplayer. However, I'm using the code snippet below.</p>
  
  <pre><code>long videoID;                 
  GtkWidget *videoWindow = NULL;
  
  
  /* need be done only once on Namb2Client startup */
  InitEGM( &amp;egm );    
  
  /* Init GTK+ */
  gtk_init( &amp;argc, &amp;argv );
  
  /* Create new GtkBuilder object */
  builder = gtk_builder_new();
  
  /* Load UI from file. If error occurs, report it and quit application. */
  if( !gtk_builder_add_from_file( builder, "layout.xml", &amp;error ) )
  {
      g_warning( "%s", error-&gt;message );
      g_free( error );
      return( 1 );
  }
  
  /* Get main window pointer from UI */
  window = GTK_WIDGET( gtk_builder_get_object( builder, "window1" ) );
  gtk_window_position(GTK_WINDOW(window), (GtkWindowPosition)GTK_WIN_POS_CENTER);
  
  
  MainWnd = GTK_WIDGET( gtk_builder_get_object( builder, "MainWnd" ) );
  
  // Setup area for Mplayer video
  videoWindow = gtk_drawing_area_new ();
  gtk_widget_set_size_request (videoWindow, 640, 180);
  gtk_fixed_put((GtkFixed *)MainWnd, videoWindow, 414, 24 );
  gtk_widget_show( videoWindow );    
  videoID = gdk_x11_drawable_get_xid( videoWindow );
  g_printf("XID = %ld\n", videoID);
  </code></pre>
  
  <p>When I run the application I get the following error:</p>
  
  <pre><code>(egm:3872): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window
  XID = 0
  </code></pre>
  
  <p>What is the proper method of obtaining the XID of a <code>GtkDrawingArea</code>? Any help would be greatly appreciated.</p>