Re: Calling X functions on gtk windows




"Mr. T. M. Sheen" <T.M.Sheen@eng.abdn.ac.uk> writes:

> I am having trouble calling an X function directly on a gtk window.
> I want to iconify the application. 
> I am just guessing that I have the correct X function, 
> I want to do something like
> 
> IconifyWindow(GtkWidget *w){
>   XIconifyWindow(GDK_WINDOW_XDISPLAY(w),GDK_WINDOW_XWINDOW(w),0);
> }
> 
>  I have also tried
> 
> IconifyWindow(GtkWidget *w){
>   XIconifyWindow(GDK_DISPLAY(),GDK_WINDOW_XWINDOW(w),0);
> }

You are casting a GtkWidget to a GdkWindow. That won't work.

Try something like:

void
IconifyWindow (GtkWidget *w)
{
  g_return_if_fail (GTK_WIDGET_REALIZED (w));

  XIconifyWindow (GDK_WINDOW_XDISPLAY (w->window), 
                  GDK_WINDOW_XWINDOW (w->window),
                  0);
}



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