Hi

> On Jun 25, 2017, at 5:40 PM, michinari.nukazawa 
> <michinari.nukaz...@gmail.com> wrote:
> 
> Hello.
> I develop vecterion vector graphics editor in GTK3/cairo.
> https://github.com/MichinariNukazawa/vecterion_vge
> I try porting the "New Document" dialog to xml file by glade from C code.
> 
> ```
>    GtkDialogFlags flags = GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT;
> 
>    dialog = gtk_dialog_new_with_buttons ("New Document",
>            NULL,
>            flags,
>            "_OK",
>            GTK_RESPONSE_ACCEPT,
>            "_Cancel",
>            GTK_RESPONSE_REJECT,
>            NULL);
> 
> ~
> 
>    gint result = gtk_dialog_run (GTK_DIALOG (dialog));
>    switch (result)
>    {
>        case GTK_RESPONSE_ACCEPT:
> ~
> ```
> This is good easy way because callback/connect not necessary OK/Cancel.
> 
> My modal dialog by glade don't return, when OK/Cancel button clicked.
> (I checked General>Window Flags>Destroy with Parent, and Modal.)
> I need GTK_RESPONSE_ACCEPT/REJECT.
> 
> Can I get the dialog with GTK_RESPONSE_ACCEPT/REJECT, by configuration in 
> glade( or other way)?
> 
> Thanks.

Yes, this is one of the weirder constructs (dialog editor UX could be much 
improved here i think)...

To do this, you need to set the "Response ID" property on the buttons you add 
in the action area.

In very recent Glade, you dont have to know the integer values and can select 
the standard named response values from a list.

Cheers,
    -Tristan

> 
> 
> -- 
> ==========
> Michinari.Nukazawa
> 
> in the project "daisy bell"
> https://daisy-bell.booth.pm/
> ==========
> 
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to