GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Sep 17, 2014 11:39 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 
Offline

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

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

by
Manju


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 5:09 pm 
Offline
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
http://www.micahcarrick.com


Top
 Profile  
 
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: Google [Bot] 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