Re: Bizarre window behavior



> >    printf("%s\n", text);
>
> You should use g_print() instead of printf(), but this is
> of course totally unrelated.

Thanks, I've since made that change.

>
> > void dialog_shown(GtkWidget *widget, gpointer data)
> > {
> >    g_list_foreach(list, do_thing, NULL);
> >    printf("\n");
> >    gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "show");
>
> What is this good for??

This was what I was trying to use to fix the problem. I left
it in there so I could show you guys what I was trying to do.

>
> >    gtk_widget_hide(widget);
>
> I'd suggest you change this line to something like
>
>      gtk_timeout_add (500, gtk_widget_hide, widget);

Wow, that works great! Thanks a lot! One question, though. I
do get a warning about using gtk_widget_hide because it is
not a GtkFunctcion. How could I get rid of that warning?

>
> >    main_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> >    gtk_window_set_position(GTK_WINDOW(main_win), GTK_WIN_POS_CENTER);
> >    gtk_window_set_title(GTK_WINDOW(main_win), "gtk_test");
> >    gtk_signal_connect(GTK_OBJECT(main_win), "destroy",
> >                       GTK_SIGNAL_FUNC(destroy), NULL);
> >    gtk_signal_connect(GTK_OBJECT(main_win), "delete_event",
> >                       GTK_SIGNAL_FUNC(destroy), NULL);
> >    gtk_window_set_policy(GTK_WINDOW(main_win), FALSE, TRUE, TRUE);
> >    gtk_widget_realize(main_win);
>
> Huh? You shouldn't call  gtk_widget_realize() w/o a good reason.
> One good reason would be if you need to access main_win->window,
> but I do not see you doing so here.

I guess I didn't understand what gtk_widget_realize() was really
used for. I can't remember where I picked that up, but I've since
removed it.

Thanks again for all of your help, Sven.

-Jeff





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