Re: GtkFileChooserDialog how to ... ?



Use dialog.add_button (const Glib::ustring& button_text, int response_id) to add your two buttons to the dialog. add_button() sets up the appropriate signals for you so that when dialog.run() returns, the returned value will be the response associated with the button that the user clicked.

You might want to consider specifying responses using the pre-defined values Gtk::RESPONSE_CANCEL and Gtk::RESPONSE_OK, names which are more meaningful than 0 and 1.

When you have retrieved all of the information you need from the dialog, you close it by deleting its instance.

On 2015/01/18 19:50, Nicolas Jäger wrote:
Hi people,
I have difficulties to figure how to use the GtkFileChooserDialog.
First In glade I added two buttons, one "OK" with the "response ID" of
"0" and the second "CANCEL" with the "response ID" of "1".

now I want to connect two signals, one for each "response ID". I'm lost
at that point, thx to the documentation :

https://developer.gnome.org/gtkmm-tutorial/stable/sec-writing-signal-handlers.html.en

I have to found some "Glib::SignalProxy" but there is a heck for me,
because I don't know to whom. Is it for a button, for the
GtkFileChooserDialog or for the GTKButtonBox, or something else ? I
didn't found the response so far...

I guess I should have something like :

[? gtk widget ?]->[? the proxy ?].connect( sigc::ptr_fun( MyFunction ));

I also have a second problem, I'm not sure if I should connect a
signal_clicked() for each button to close the GtkFileChooserDialog, or
if there is some functions especialy to close a GtkFileChooserDialog.

For information, I'm using glade3.

Regards,
/nicoo
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list



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