Re: hide/show GtkDialogs



Havoc Pennington wrote:

I use libglade and wanted to get a GdkWindow* out
of my GtkDialog* widget, like in this code:

   GtkWidget *dialog1;

   dialog1 = glade_xml_get_widget (xmlfile, "dialog1");
   GdkWindow *diagdk = gtk_widget_get_parent_window (dialog1);
   gdk_window_show (diagdk);


But it doesn't seem to work.  I think


What are you trying to do there? Maybe you mean:
 dialog1 = glade_xml_get_widget (xmlfile, "dialog1");
 gtk_widget_show (dialog1);


I have a dialog-window, that notifies the user about some
error, etc.
I wanted to use a generic callback function, that I could use for
hiding/showing windows, so I thought about something like
this:

void window_visibility (GtkWidget* widget, gpointer p_vis)
{
  static gint vis = GPOINTER_TO_INT (p_vis);
  static GdkWindow *muata = gtk_widget_get_parent_window (widget);

  if ( vis )                        /* vis != 0 */
      gdk_window_show (muata);
  else                              /* vis == 0 */
      gdk_window_hide (muata);
}


Now I had the problem that I wanted to call this function manually
(not by a callback) - and all I had was the:     GtkWidget* dialog



Bernd



--
Kirkland, Illinois, law forbids bees to fly over the village or through any of its streets.





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