Re: Help with modal dialog



Sounds like your dialog goes out of scope when the "return 0" statement executes. Is the pointer to the dialog stored on the stack as a local variable, or as a class variable that will be preserved until the class is destroyed?

On 2016-04-20 06:50 PM, Matthew A. Postiff wrote:
On 4/20/2016 2:07 AM, Marius Gedminas wrote:
On Tue, Apr 19, 2016 at 10:07:50AM -0400, Matt Postiff wrote:
I have a working dialog that displays a system log file in "real time"
in my gtk2 Windows/Linux app. It is modal.

What I want to do is make it non-modal so it can float off to the side
of my app and always be visible while I work in the app.

I have tried to gtk_window_set_modal to FALSE and also set <property
name="modal">False</property> in the gtkbuilder xml.

A snippet of the code and xml is at http://pastebin.com/mACPZP85

Any ideas what I'm doing wrong? Thank you.
How are you displaying that dialog?  Your code snipped doesn't include
that part.  Make sure you don't use gtk_dialog_run().  Use
gtk_widget_show() or gtk_widget_show_all() (whichever is appropriate)
and return to the main loop.

Marius Gedminas
You are right. I had:
return gtk_dialog_run(GTK_DIALOG(dialog));

I'm very new at this. I tried replacing that with:
gtk_widget_show_all(dialog);
return 0; // I don't use the return value anyway

and the dialog momentarily appears, then disappears quickly before I can
see if the guts of it are all present.

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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