[Glade-users] Help with dialog box

Micah Carrick email at micahcarrick.com
Thu Jan 4 13:48:27 EST 2007


I've modified your glade dialog so that the "Cancel" button resides in a 
dialog_action_area. You could then run the dialog using:

void on_button_pressed () 
{

        GladeXML *gxml = glade_xml_new ("mydir/dialog.glade", 
"my_dialog", NULL);
        GtkWidget *dialog = glade_xml_get_widget(gxml, "my_dialog");
        GtkResponseType result;

        result = gtk_dialog_run (GTK_DIALOG(dialog));

        if (result == GTK_RESPONSE_CANCEL)
        {
                /* This will always be the result because "cancel" is 
the only button */
        }
       
        /* destroy widget */
        gtk_widget_destroy (dialog);
}

That's just one way. You could do it the way you're trying to an have 
code to handle the cancel button's "clicked" signal, but this might be 
an easier solution.

Cheers,

- Micah Carrick
  http://www.micahcarrick.com | http://www.gtkforums.com

Paolo Franzetti wrote:
> Hello.
>
> I would like to open a dialog box from my main GTK app.
> To do this I have in my main code the line:
>
>
> dialog=glade_xml_new(/mydir/dialog.glade" , NULL, NULL);
>
>
> and the glade file attached.
>
> The dialog opens but it is freeze; I cannot do anything in it ...
>
> What am I doing wrong?
>
> Thanks,
> Paolo
> ------------------------------------------------------------------------
>
> _______________________________________________
> Glade-users maillist  -  Glade-users at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20070104/a615db38/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dialog.glade
Type: application/x-glade
Size: 4113 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20070104/a615db38/attachment.bin 


More information about the Glade-users mailing list