Re: Can I get GTK_RESPONSE_ACCEPT/REJECT from modal dialog by glade.
- From: "michinari.nukazawa" <michinari nukazawa gmail com>
- To: Tristan Van Berkom <tristan vanberkom codethink co uk>
- Cc: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Re: Can I get GTK_RESPONSE_ACCEPT/REJECT from modal dialog by glade.
- Date: Sun, 25 Jun 2017 18:23:44 +0900
Hi
To do this, you need to set the "Response ID" property on the buttons you add in the action area.
It works.
Thank you!
I love glade, this is good visual gui editor. (I favorite feature is
undo/redo.)
glade 3.18.3 in Ubuntu16.04 is not recent. :)
https://lazka.github.io/pgi-docs/Gtk-3.0/enums.html#Gtk.ResponseType
Thanks.
On 2017年06月25日 18:04, Tristan Van Berkom wrote:
Hi
On Jun 25, 2017, at 5:40 PM, michinari.nukazawa <michinari nukazawa 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
--
==========
Michinari.Nukazawa
in the project "daisy bell"
https://daisy-bell.booth.pm/
==========
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]