[Glade-users] Help with dialog box


Please keep replies on-list, for the benefit of search engines, other  
readers, etc.; I'm CC'ing this back to the list.

On Jan 4, 2007, at 11:12 AM, Paolo Franzetti wrote:

My code is very simple. I have this function:

void on_button_pressed() {

   dialog=glade_xml_new(/mydir/dialog.glade" , NULL, NULL);


which is called on a button press in my main window.

When I press the button I see the dialog, but it is completely
stuck; I cannot do anything in it (press button, open the combo box
list, close the dialog).

Then I'm not sure what's going on; the problem is likely somewhere  
else in your code.  Perhaps something else is currently active as a  
modal dialog?  If this new dialog is shown in response to a button in  
a modal dialog, it won't respond to anything unless it's set up to be  
modal (and it may need to be a transient child of the first dialog -  
see gtk_window_set_transient_for).  The following program works  
perfectly with your glade file on my system:

==== BEGIN SNIP ====
#include <gtk/gtk.h>
#include <glade/glade-xml.h>

int main(int argc, char *argv[])
     gtk_init(&argc, &argv);

     GladeXML *dlg = glade_xml_new("dialog.glade", NULL, NULL);

     return 0;

void on_about_cancel_clicked(GtkButton *button)
==== END SNIP ====

- Michael

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]