RE: [gtkmm] Overloading on_response() member of a Dialog object.



I finally decided to go with a Gtk::Window  instead of a Gtk::Dialog.
Since I've never been able to mask the signal emission for certain
button of the dialog box, I created my own window with a set of events
that i can connect to from my main application window.

Le lun 23/06/2003 à 04:36, Murray Cumming Comneon com a écrit :
> It's possible that you need to (or don't need to) call the base method.
> 
> Murray Cumming
> murrayc usa net
> www.murrayc.com
> 
> > -----Original Message-----
> > From: Jean-Luc Bedwani [mailto:jlbedwani imascope ca] 
> > Sent: Mittwoch, 18. Juni 2003 20:18
> > To: gtkmm-list gnome org
> > Subject: [gtkmm] Overloading on_response() member of a Dialog object.
> > 
> > 
> > I would like to create a dialog box with an Apply button in 
> > the "action
> > area section" of the dialog. I have binded the ID value of 0 to the
> > Apply button so I can detect between an Apply, Cancel or 
> > Validate button
> > click.
> > 
> > Now I wish to do some processing in the dialog box when the 
> > Apply button
> > is pushed. I have linked the clicked event of the button to the
> > appropriate function handler.
> > 
> > Since I don't want to close the dialog box if the apply button is
> > pushed, I have overloaded the on_response function of a dialog object,
> > and decides to call the response() member only for the Cancel and
> > Validate button. The Validate button would not send any signals to the
> > caller of the dialog.run()
> > 
> > After some debugging I figured-out that my overloaded function of
> > on_resume() is properly called. However, my overloaded 
> > function has been
> > called, the response() member is called again by some other code. This
> > causes a run time error since the run() call already exited by my call
> > to response(). When the second response() is called, my application
> > crashes.
> > 
> > Now Since this extra code calls response(), it cause the click of my
> > validate button to exit the dialog box.
> > 
> > Does anybody knows what is happening here?
> > 
> > It is possible to have a button in the "action area" that 
> > does not cause
> > the dialog to close?
> > 
> > For information, I am using gtkmm 2.0.0. I also looked the 
> > code of gtkmm
> > for the dialog object, and it seems ok for me. But since I am 
> > quite new
> > to GTK and gtkmm I rather ask the community for my special 
> > way of using
> > a dialog box.
> > 
> > Maybe I am doing a bad design decision by using a dialog object that
> > way. If it is the case, please let me know, I would probably use a
> > window object instead. But then I loose the nice way of calling run()
> > and retrieving the ID of what button was clicked.
> > 
> > -- 
> > Jean-Luc Bedwani <jlbedwani imascope ca>
> > Imascope Inc.
> > 
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> > 
-- 
Jean-Luc Bedwani <jlbedwani imascope ca>
Imascope Inc.




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