Glade 3 Standard Button Layout
Asked Answered
R

1

0

I want to create a dialog using Glade 3 (or gtk and Python). In Glade 2 if you wanted to create a dialog box there was an option to set a "standard button layout" which would automatically create an Ok button and a Cancel button which return either gtk.RESPONSE_OK or gtk.REPONSE_CANCEL. This feature has not been reimplmented in Glade 3.

How can I create a dialog which will have ok and cancel buttons which return the correct response?

Cheers,

Pete

Resolution answered 27/4, 2010 at 23:18 Comment(0)
D
0

You can create them manually in Glade; the response code can unfortunately only be set to a number. The numbers you need are here: OK is -5, Cancel is -6.

Or you can create it in code:

dialog = gtk.MessageDialog(flags=gtk.DIALOG_MODAL, 
    buttons=gtk.BUTTONS_OK_CANCEL, 
    message_format='Are you sure you want to reticulate the splines?')
response = dialog.run()
dialog.destroy()
Dejecta answered 28/4, 2010 at 6:34 Comment(1)
The GTK3 response codes have move to her: developer.gnome.org/gtkmm/stable/group__gtkmmEnums.htmlChroma

© 2022 - 2024 — McMap. All rights reserved.