patch proposal to iconize windows



hello
as I was still with an old problem of creating iconized windows
at program startup, I finally found an Xlib call that was
exactly what i wanted.
But i'm really reluctant to call Xlib from my program, so
i prefer propose an extension to gtk, with the following patch,
that adds a new function and modifies testgtk accordingly.

Perhaps this could be useful enougth to find its way in gtk
mainstream...

	pierre
----
hanser@club-internet.fr

----
diff -x*.rom -x*.obj -x*.lst -x*.bin -x*.m51 -x*.map -x*.l51 -xSCCS -x .make.state -x .nse_depinfo -x*.pre -x*.h0? -rC3 gtk+-1.0.3.orig/gdk/gdk.h gtk+-1.0.3/gdk/gdk.h
*** gtk+-1.0.3.orig/gdk/gdk.h	Tue Apr 14 02:49:03 1998
--- gtk+-1.0.3/gdk/gdk.h	Mon May 25 13:41:29 1998
***************
*** 130,135 ****
--- 130,136 ----
  void	      gdk_window_show	     (GdkWindow	   *window);
  void	      gdk_window_hide	     (GdkWindow	   *window);
  void	      gdk_window_withdraw    (GdkWindow	   *window);
+ void	      gdk_window_iconize     (GdkWindow    *window);
  void	      gdk_window_move	     (GdkWindow	   *window,
  				      gint	    x,
  				      gint	    y);
diff -x*.rom -x*.obj -x*.lst -x*.bin -x*.m51 -x*.map -x*.l51 -xSCCS -x .make.state -x .nse_depinfo -x*.pre -x*.h0? -rC3 gtk+-1.0.3.orig/gdk/gdkwindow.c gtk+-1.0.3/gdk/gdkwindow.c
*** gtk+-1.0.3.orig/gdk/gdkwindow.c	Mon May  4 00:16:44 1998
--- gtk+-1.0.3/gdk/gdkwindow.c	Mon May 25 15:20:27 1998
***************
*** 711,716 ****
--- 711,728 ----
  }
  
  void
+ gdk_window_iconize (GdkWindow *window)
+ {
+   GdkWindowPrivate *private;
+ 
+   g_return_if_fail (window != NULL);
+ 
+   private = (GdkWindowPrivate*) window;
+   if (!private->destroyed)
+     XIconifyWindow (private->xdisplay, private->xwindow, gdk_screen);
+ }
+ 
+ void
  gdk_window_withdraw (GdkWindow *window)
  {
    GdkWindowPrivate *private;
***************
*** 719,725 ****
  
    private = (GdkWindowPrivate*) window;
    if (!private->destroyed)
!     XWithdrawWindow (private->xdisplay, private->xwindow, 0);
  }
  
  void
--- 731,737 ----
  
    private = (GdkWindowPrivate*) window;
    if (!private->destroyed)
!     XWithdrawWindow (private->xdisplay, private->xwindow, 0); /* should be also gdk_screen instead of 0 ??? */
  }
  
  void
diff -x*.rom -x*.obj -x*.lst -x*.bin -x*.m51 -x*.map -x*.l51 -xSCCS -x .make.state -x .nse_depinfo -x*.pre -x*.h0? -rC3 gtk+-1.0.3.orig/gtk/testgtk.c gtk+-1.0.3/gtk/testgtk.c
*** gtk+-1.0.3.orig/gtk/testgtk.c	Wed May 13 08:17:47 1998
--- gtk+-1.0.3/gtk/testgtk.c	Mon May 25 13:41:41 1998
***************
*** 4682,4687 ****
--- 4682,4693 ----
      gtk_widget_destroy (rings);
  }
  
+ void gtk_win_iconic (GtkWidget *widget, gpointer   data)
+ {
+ 	GtkWidget *  myWin =(GtkWidget*)data;
+ 
+ 	gdk_window_iconize(myWin->window);
+ }
  void
  create_wmhints ()
  {
***************
*** 4728,4733 ****
--- 4734,4747 ----
        gtk_box_pack_start (GTK_BOX (box1), label, TRUE, TRUE, 0);
        gtk_widget_show (label);
  
+       button = gtk_button_new_with_label ("iconize");
+ 
+       gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
+ 				 GTK_SIGNAL_FUNC(gtk_win_iconic),
+ 				 GTK_OBJECT (window));
+ 
+       gtk_box_pack_start (GTK_BOX (box1), button, TRUE, TRUE, 0);
+       gtk_widget_show (button);
  
        separator = gtk_hseparator_new ();
        gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);


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