RE: nonmodal dialog, additional main windows



Thanks. Actually my dialog is an inner class -- a member of the class that invokes the dialog. Also, this invoking (outer) 
class has sufficient lifetime for the dialog. So I don't think this is the problem.

As mentioned, I'm new to GTK+ and gtkmm, and have more experience with java/Swing and C#/forms than with C++.  
Overall I've been quite impressed with GTK+ and gtkmm, but if you don't mind a suggestion from a neophyte... The gtkmm 
documentation doesn't seem to include any examples of the two issues that have been giving me trouble, a modeless dialog 
or an application with more than one main window. Also, these seem to work quite differently from the widget sets on other 
platforms with which I'm familiar. So, if someone could post code samples illustrating how these work, and/or consider including 
such samples in a future version of the gtkmm book, I think it might be quite helpful.

Thanks again,

Matthew Fleming
________________________________________
From: Mohith Manoj [mohithmanoj gmail com]
Sent: Monday, April 13, 2009 6:41 AM
To: Fleming, Matthew
Subject: Re: nonmodal dialog, additional main windows

Hey Mathew,

I was wondering if it is the scope of your child dialog, that is giving you trouble. For making the dialog modal, it is sufficient that the object be instantiated in a method itself. How ever if you want your dialog to be modeless, it has to be the member of the class that invokes the dialog, plus it would be nice if that class itself has a sufficient life time.

On Mon, Apr 13, 2009 at 2:38 AM, Fleming, Matthew <mfleming mcw edu<mailto:mfleming mcw edu>> wrote:
Folks,

Would really appreciate your help with the following. If its not obvious, I'm a neophyte with gtkmm.

I would like to create a nonmodal (nonblocking) dialog. I can create a dialog by subclassing Gtk::Dialog and using the run method of the subclass to show it. This works fine but the dialog is modal. I have tried making it nonmodal by calling show() instead of run() but then it doesn't appear at all. I have also tried making it nonmodal by calling the constructor of the superclass (ie Dialog) with the modal argument set to false, in the initialization list of my subclass' constructor, but this doesn't seem to change anything.

I thought perhaps I should subclass Gtk::Window instead of Gtk::Dialog to get around the problem. But I don't seem to be able to show a second main window. I show the first with Gtk::Main.run() and tried to show a second with its show() method, but it doesn't appear.

I apologize if these questions have simple answers. I'm mostly a java programmer and this stuff works quite differently in java, which may explain my confusion. Thanks in advance for your help.

Dermite
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org<mailto:gtkmm-list gnome org>
http://mail.gnome.org/mailman/listinfo/gtkmm-list



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