Can I get GTK_RESPONSE_ACCEPT/REJECT from modal dialog by glade.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can I get GTK_RESPONSE_ACCEPT/REJECT from modal dialog by glade.

michinari.nukazawa
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.


--
==========
Michinari.Nukazawa

in the project "daisy bell"
https://daisy-bell.booth.pm/
==========

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can I get GTK_RESPONSE_ACCEPT/REJECT from modal dialog by glade.

Tristan Van Berkom-3
Hi

> On Jun 25, 2017, at 5:40 PM, michinari.nukazawa <[hidden email]> 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
> [hidden email]
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can I get GTK_RESPONSE_ACCEPT/REJECT from modal dialog by glade.

michinari.nukazawa
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 <[hidden email]> 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
>> [hidden email]
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>>

--
==========
Michinari.Nukazawa

in the project "daisy bell"
https://daisy-bell.booth.pm/
==========

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

gtk-update-icon-cache.exe is not work?

michinari.nukazawa
In reply to this post by michinari.nukazawa
Hello.
I develop vecterion vector graphics editor in GTK3/cairo.
https://github.com/MichinariNukazawa/vecterion_vge

I get this error message.
===
(vecterion_vge.exe:5292): Gtk-WARNING **: Could not load a pixbuf from
icon theme.
This may indicate that pixbuf loaders or the mime database could not be
found.
**
Gtk:ERROR:gtkiconhelper.c:493:ensure_surface_for_gicon: assertion
failed: (destination)
===


I try update gtk library 3.10.4-20131202 (official) to
3.22.15-1-20170610 (unofficial).
new binary (is under uri) by https://twitter.com/niloufarjp/ and my
repackage script.

I already fix loaders.cache need libpixbufloader-svg.dll .
and tryed using gtk-update-icon-cache.exe is successed.


Why icon load error but loaded libpixbufloader-svg.dll and
gtk-update-icon-cache.exe is successed.
I drop other need library/binary?
I forget other process?


gtk library:
https://box.yahoo.co.jp/guest/viewer?sid=box-l-m4xqci277itzhqw6phs2dmo7pi-1001&uniqid=891184c1-d3f2-451d-9d01-a42fa522643c#du%3D891184c1-d3f2-451d-9d01-a42fa522643c%26ds%3Dbox-l-m4xqci277itzhqw6phs2dmo7pi-1001%26vt%3Dpublic%26lf%3Dlist%26ls%3D1%26lm%3D20
repackage script:
https://github.com/MichinariNukazawa/vecterion_vge/blob/master/deploy/win/gtk_library/gtk_library_repackage.sh

Thanks.
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk-update-icon-cache.exe is not work?

michinari.nukazawa
Hello.

I tryed run vecterion_vge.exe in package directory. this directory has
all gtk library and other files.

I don't get that error message, and upon empty application window.
(and exist other problem...)

It seems that the file was missing.
I have not been able to identify that file.

Thanks.



On 2017年07月25日 23:21, michinari.nukazawa wrote:

> Hello.
> I develop vecterion vector graphics editor in GTK3/cairo.
> https://github.com/MichinariNukazawa/vecterion_vge
>
> I get this error message.
> ===
> (vecterion_vge.exe:5292): Gtk-WARNING **: Could not load a pixbuf from
> icon theme.
> This may indicate that pixbuf loaders or the mime database could not
> be found.
> **
> Gtk:ERROR:gtkiconhelper.c:493:ensure_surface_for_gicon: assertion
> failed: (destination)
> ===
>
>
> I try update gtk library 3.10.4-20131202 (official) to
> 3.22.15-1-20170610 (unofficial).
> new binary (is under uri) by https://twitter.com/niloufarjp/ and my
> repackage script.
>
> I already fix loaders.cache need libpixbufloader-svg.dll .
> and tryed using gtk-update-icon-cache.exe is successed.
>
>
> Why icon load error but loaded libpixbufloader-svg.dll and
> gtk-update-icon-cache.exe is successed.
> I drop other need library/binary?
> I forget other process?
>
>
> gtk library:
> https://box.yahoo.co.jp/guest/viewer?sid=box-l-m4xqci277itzhqw6phs2dmo7pi-1001&uniqid=891184c1-d3f2-451d-9d01-a42fa522643c#du%3D891184c1-d3f2-451d-9d01-a42fa522643c%26ds%3Dbox-l-m4xqci277itzhqw6phs2dmo7pi-1001%26vt%3Dpublic%26lf%3Dlist%26ls%3D1%26lm%3D20 
>
> repackage script:
> https://github.com/MichinariNukazawa/vecterion_vge/blob/master/deploy/win/gtk_library/gtk_library_repackage.sh 
>
>
> Thanks.


--
==========
Michinari.Nukazawa

in the project "daisy bell"
https://daisy-bell.booth.pm/
==========

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Loading...