Re: How to run single instance of a window?



Since the index has to be a global variable anyways, why not make the
window a global instead.

It starts out as NULL.  Connect the 'destroy' or 'delete_event' signal to
a function that sets the window back to NULL after destroying it.

Then, before creating a new window, check if the window is NULL.

You would have to do all this anyways for the index variable.  This
approach allows you to have one less variable in exchange for making the
window global, instead of index.

Daniel.

On Thu, 8 Aug 2002, Ricky Foo wrote:

> what I normally do is that you create a index, assigns 1 or 0 to it based on
> the current state of the window. it should work out fine.
>
> Ricky
>
>
> >Hi all,
> >
> >I have  a simple problem. I want to have a single instance of a window,
> >i.e, Suppose I create any window
> >on clicking a button, now when I click the same button again it should
> >not create the another instance of
> >the popup window (as it is already there). Any idea how to achieve this?
> >
> >Thanks in advance.
> >
> >Rahul.
>
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>




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