Re: AW: [gtkmm] Dialog and MessageDialog?



On Mon, 2002-08-12 at 18:45, Key88 SF wrote:
> Finally this works! Thank you for that suggestion. I needed to call 
> Gtk::Main::run(), which I thought was only called once for the entire 
> program.

This is not the only way to do this. It's just one way. You really
should look at the examples.

> Also, my Gtk+2.0.5 examples don't have the dialog example -- I had 
> to look at the gtkmm2x examples.

I assume that your first sentences are about using gtkmm 1.2. gtkmm2 is
much easier.

Why do you need to see GTK+2 examples?

> 
> Cheers,
> 
> Dave
> 
> 
> >From: "Meier, Elke" <elke meier sysde eads net>
> >To: "'Key88 SF'" <key88sf hotmail com>
> >CC: gtkmm-list gnome org
> >Subject: AW: [gtkmm] Dialog and MessageDialog?
> >Date: Mon, 12 Aug 2002 09:55:38 +0200
> >MIME-Version: 1.0
> >Received: from gatek.vs.dasa.de ([53.122.197.194]) by 
> >mc2-f5.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.4905); Mon, 12 Aug 
> >2002 00:55:45 -0700
> >Received: from mailrelay1.vs.dasa.de by gatek.vs.dasa.de          via smtpd 
> >(for mc2.law16.hotmail.com [65.54.254.145]) with SMTP; 12 Aug 2002 07:56:47 
> >UT
> >Received: from ulm001.sysde.corp (ulm001.sysde.corp [149.207.22.81])by 
> >mailrelay1.de.sysde.corp (8.10.2+Sun/8.10.2) with ESMTP id 
> >g7C7tix23308;Mon, 12 Aug 2002 09:55:44 +0200 (MET DST)
> >Received: by ulm001.sysde.corp with Internet Mail Service (5.5.2656.59)id 
> ><QMB3MKSY>; Mon, 12 Aug 2002 09:55:44 +0200
> >Message-ID: <F5AFD56E32E8D21191090060974838B103BD93FD ulm003 vs dasa de>
> >X-Mailer: Internet Mail Service (5.5.2656.59)
> >Return-Path: elke meier sysde eads net
> >X-OriginalArrivalTime: 12 Aug 2002 07:55:45.0924 (UTC) 
> >FILETIME=[AA351440:01C241D5]
> >
> >I remember getting this to work with Gtk 1.2.
> >Have you looked at the dialog example ? They define a run() method in
> >the dialog class which returns with the answer after the user clicked
> >OK or Cancel.
> >  I believe it calls Gtk::Main::run() (better check on this again).
> >  The OK and Cancel signal handlers set a global variable in the dialog
> >  class and call Gtk::Main::quit(), so the control returns to the
> >dialogs run method, which returns the global variable.
> >
> >I didn't mess with delete_event_impl(), but instantiated a new
> >dialog every time I needed it.
> >
> >Cheers,
> >	Elke
> > >
> > > Sorry to go on with this, but I tried just using show(), and
> > > the dialog gets
> > > displayed for a millisecond, then immediately closes. I need
> > > it to stay open
> > > until the user clicks the "OK" button. It looks like there
> > > may be a problem
> > > with the "delete_event_impl" mechanism -- I ran the
> > > hello,world example code
> > > which is supposed to override the delete_event_impl() so the
> > > window never
> > > gets destroyed, and the override never gets called!
> > >
> > > From the GTK 1.2 tutorial hello world example, the function
> > > below NEVER gets
> > > called!
> > >
> > > int HelloWorld::delete_event_impl(GdkEventAny *event)
> > > {
> > >   cout << "delete event occured" << endl;
> > >
> > >   // if you return false in the "delete_event" signal handler,
> > >   // GTK will emit the "destroy" signal.  Returning true means
> > >   // you don't want the window to be destroyed.
> > >   // This is useful for popping up 'are you sure you want to quit ?'
> > >   // type dialogs.
> > >
> > >   // Change true to false and the main window will be destroyed with
> > >   // a "delete_event".
> > >   return true;
> > > }
> > >
> > > Also - none of the examples that are shipped with gtkmm 1.2
> > > make use of
> > > ADDITIONAL popup windows. I would think this is such a common
> > > thing that
> > > SOMEONE would have done it already, no?
> > >
> > > Thanks again,
> > >
> > > Dave
> > >
> > >
> > > >From: Murray Cumming <murrayc usa net>
> > > >Reply-To: murrayc usa net
> > > >To: Key88 SF <key88sf hotmail com>
> > > >CC: gtkmm-list <gtkmm-list gnome org>
> > > >Subject: Re: [gtkmm] Dialog and MessageDialog?
> > > >Date: 11 Aug 2002 19:11:57 +0100
> > > >MIME-Version: 1.0
> > > >Received: from [209.116.70.73] by hotmail.com (3.2) with ESMTP id
> > > >MHotMailBF1FF2CC00CA40043218D1744649CCFF0; Sun, 11 Aug 2002
> > > 11:07:13 -0700
> > > >Received: from moniker.gnome.org (moniker.gnome.org [127.0.0.1])by
> > > >mail.gnome.org (Postfix) with ESMTPid 5A8FA18849; Sun, 11
> > > Aug 2002 14:07:05
> > > >-0400 (EDT)
> > > >Received: from exchange.blueprint.net (unknown [195.13.99.210])by
> > > >mail.gnome.org (Postfix) with ESMTP id CB35218205for
> > > ><gtkmm-list gnome org>; Sun, 11 Aug 2002 14:06:28 -0400 (EDT)
> > > >Received: from [192.168.21.126] ([192.168.21.126]) by
> > > >exchange.blueprint.net with Microsoft
> > > SMTPSVC(5.0.2195.4905); Sun, 11 Aug
> > > >2002 19:06:47 +0100
> > > >From gtkmm-list-admin gnome org Sun, 11 Aug 2002 11:07:14 -0700
> > > >Delivered-To: gtkmm-list gnome org
> > > >In-Reply-To: <F2511WgsxNKon644GkF00013b04 hotmail com>
> > > >References: <F2511WgsxNKon644GkF00013b04 hotmail com>
> > > >X-Mailer: Ximian Evolution 1.0.7 Message-Id:
> > > ><1029089517 2186 270 camel localhost localdomain>
> > > >X-OriginalArrivalTime: 11 Aug 2002 18:06:47.0967 (UTC)
> > > >FILETIME=[DC1322F0:01C24161]
> > > >Sender: gtkmm-list-admin gnome org
> > > >Errors-To: gtkmm-list-admin gnome org
> > > >X-BeenThere: gtkmm-list gnome org
> > > >X-Loop: gtkmm-list gnome org
> > > >X-Mailman-Version: 2.0.8
> > > >Precedence: bulk
> > > >List-Help: <mailto:gtkmm-list-request gnome org?subject=help>
> > > >List-Post: <mailto:gtkmm-list gnome org>
> > > >List-Subscribe:
> > > ><http://mail.gnome.org/mailman/listinfo/gtkmm-list>,<mailto:g
> >tkmm-list-request gnome org?subject=subscribe>
> > >List-Id: gtkmm general discussion <gtkmm-list.gnome.org>
> > >List-Unsubscribe:
> > ><http://mail.gnome.org/mailman/listinfo/gtkmm-list>,<mailto:gtkmm-list-requ
> >est gnome org?subject=unsubscribe>
> > >List-Archive: <http://mail.gnome.org/archives/gtkmm-list/>
> > >
> > >On Sun, 2002-08-11 at 18:07, Key88 SF wrote:
> > > > Ok - how do I do something like that in gtkmm1.x ? I can build the GUI
> > > > window fine, but the "run_and_close()" equivalent I don't see how to 
> >do.
> >
> > >The
> > > > only "run" and "response" methods are in the underlying Gtk objects.
> > >
> > >I don't think that there is any gtk_dialog_run() function in GTK+ 1.2.
> > >
> > >I think you just need to show() the dialog, and there's probably a
> > >response signal. But it would be better to look at the examples in gtkmm
> > >1.2.
> > >
> > >
> > >--
> > >Murray Cumming
> > >murrayc usa net
> > >www.murrayc.com
> > >
> > >_______________________________________________
> > >gtkmm-list mailing list
> > >gtkmm-list gnome org
> > >http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >
> >
> >
> >
> >
> >
> >_________________________________________________________________
> >Chat with friends online, try MSN Messenger: http://messenger.msn.com
> >
> >_______________________________________________
> >gtkmm-list mailing list
> >gtkmm-list gnome org
> >http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 
> 
> 
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 
-- 
Murray Cumming
murrayc usa net
www.murrayc.com




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