[gktbuilder+glade3.4]Child-window can not recreat

I wirte a sample application use GktBuilder + glade3. there are one
main-window(top level) and some other child-window (top level too, creat and
show when the menu item is actived, in my code it is named window_rank).
after close the child-window for first time, i click the menu item again.
But this child-window cannot be created and showed again. with many errors
or warming like this:

(lsacs_gsecu:11866): GLib-GObject-WARNING **: invalid unclassed pointer in
cast to `GtkCList'

(lsacs_gsecu:11866): Gtk-CRITICAL **: gtk_clist_append: assertion
`GTK_IS_CLIST (clist)' failed

(lsacs_gsecu:11866): GLib-GObject-WARNING **: invalid unclassed pointer in
cast to `GtkCList'

(lsacs_gsecu:11866): Gtk-CRITICAL **: gtk_clist_set_text: assertion
`GTK_IS_CLIST (clist)' failed

(lsacs_gsecu:11866): GLib-GObject-WARNING **: invalid unclassed pointer in
cast to `GtkCList'


i thinke when i destroy the child-window, these UI data are freed, so i
cannot use builder again.
some one tell me that i can hide the child-window instead of destroy it, but
it will bring many terrible problem specially when the window contain
so, do anyone can tell me how can i do with that child-window, or tell me
where can i find some example which develop by gktbuilder+glade

extremely grateful

*my code is here:*


#include "gsecu.h"
#define BUILDER_XML_FILE "gsecu.xml"

gboolean init_app (LsacsGsecu *editor);
int main (int argc, char *argv[])
        LsacsGsecu *gsecu;
        gsecu = g_slice_new(LsacsGsecu);
        gtk_init (&argc, &argv);
        if (init_app (gsecu) == FALSE) return 1; /* error loading UI */
        return 0;

gboolean init_app (LsacsGsecu *gsecu)

        GtkBuilder *builder;
        GError                  *err=NULL;
        /* use GtkBuilder to build our interface from the XML file */
        builder = gtk_builder_new ();
        if (gtk_builder_add_from_file (builder, BUILDER_XML_FILE, &err) == 0)
                error_message (err->message);
                g_error_free (err);
                return FALSE;

        /* get the widgets which will be referenced in callbacks */
        gsecu->window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
        gsecu->window_rank = GTK_WIDGET (gtk_builder_get_object
(builder, "window_rank"));
        gsecu->clist_rank = GTK_WIDGET (gtk_builder_get_object
(builder, "clist_rank"));
        gsecu->entry_rank = GTK_WIDGET (gtk_builder_get_object
(builder, "entry_rank"));
        /* connect signals, passing our LsacsGsecu struct as user data */
        gtk_builder_connect_signals (builder, gsecu);
        /* free memory used by GtkBuilder object */
        g_object_unref (G_OBJECT (builder));
        return TRUE;


void on_initrank_activate (GtkObject *object, LsacsGsecu *gsecu)

        struct stat filebuf;
        gchar *p_space = " ";
        int fd,ranknum;
        int i;
        RANKNAME_SREC rankbuf;
                OK_dialog("èåranknameæäåé", gsecu->window_rank);
                gtk_clist_append(GTK_CLIST(gsecu->clist_rank), &p_space);

        gtk_clist_set_column_width (GTK_CLIST (gsecu->clist_rank), 0, 270);

i have spended many many time to solve it, can some one help me !

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