Re: GTK Problem



----- Original Message -----
From: "Olexiy Avramchenko" <ath beast stu cn ua>
To: "James Jensen" <jmjensen002 hotmail com>
Cc: <gtk-list gnome org>
Sent: Wednesday, August 28, 2002 1:38 AM
Subject: Re: GTK Problem


> James Jensen wrote:
>
> > Hi, everyone. I'm writing an open-source text editor with wGLADE and
> > Dev-C++ w/DevEx (which provides the GTK libs) named Free Notepad.
> >
> > I'm having trouble with opening files. What happens is that when I
> > click "Open File" under the "File" menu, a GTK file_selection window
> > appears. I select the file, and it loads its contents into the editor.
> >
> > The problem comes when I go to open a new file. I designed the program
> > to open up a new window if the contents of the first have been changed
> > (such as through opening a file). The program appears to work
> > correctly, opening a new window with the file contents, but when I
> > close one of the windows, they *all* close.
> >
> >
> > void
> > on_btnOpenFile_clicked (GtkButton *button, gpointer user_data)
> > {
> >    /* This function is called when the "OK" button is clicked in the
> > file_opener from on_mnuFileOpen_activate. */
> >
> >    temp.file_selected = TRUE;
> >    gtk_main_quit();
>
>        ^^^^^^^^^^^^^^
> Hello, this one is for terminate gtk+ application. You should use
> gtk_widget_destroy instead. Pass pointer to widget you want
> to destroy in user_data and call gtk_widget_destroy(GTK_WIDGET(user_data))
>

No, I don't think that's right because all the gtk_main_quit() here is tell
the instance of gtk_main() in on_mnuFileOpen_activate to return, letting it
go through the rest of the 'Open_activate code, which is does go through. So
this isn't the problem. Besides, if I destroyed the file_selection (that's
what you're hinting at, right?), I won't be able to get at the selected
filename.

Thanks anyway.

-J. Jensen



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