GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Nov 28, 2015 11:49 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: window problem
PostPosted: Wed Apr 11, 2007 11:56 am 

Joined: Wed Apr 11, 2007 11:47 am
Posts: 3

i have small problem , i wrote a small program ie two buttons are placed in a widget,

first button for creating a new window(when the user click that button new window will be opend)
second button is close the first button created window

but my problem is when i click the first button more than one time so many windows are opened ,at that time i pressed second button only one window will be closed?
remaining windows are still alive?

so how to solve it?

any body kelp


 Post subject:
PostPosted: Wed Apr 11, 2007 5:09 pm 
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
You can use a single global or perhaps static variable for the window. Then in that first button's callback, check if the window is created and visible. If it is, exit the callback. If it's created but has been hidden, show the window, and if it's not been created, only then call gtk_window_new().

Micah Carrick - Forum Administrator

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group