LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-29-2008, 08:19 PM   #1
kanik
LQ Newbie
 
Registered: Aug 2008
Posts: 7

Rep: Reputation: 0
Closing a window


Hey. My project requires me to display the image based on an option of yes or no, and then wait for a few seconds and exit.
I have an if loop like this:

PHP Code:
 if (...) 
              {    
              
system("display correct.bmp");
              }
           else if (...) 
              {    
              
system("display wrong.bmp");
              }

           else 
cout << "Please click on Yes or No"<< endl
Now I need to add a delay and close the new window with the image and the original window. I don't have problem with the original window but how do I close the new image window without making the user clicking on the close button?

I'm also using SDL, and I tried SDL_Delay(1000) and SDL_Quit(), but this adds a delay after I manually close the image, and then the original window closes.

Can anyone help me with this please?

Thanks
--Kanik
 
Old 09-30-2008, 03:28 AM   #2
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
Since the new 'window' is a separate process, you shall have to send it a signal telling it to terminate. You can review the glibc documentation about processes and signals for how to do this.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My bash window keeps closing... otacon 14112 Linux - Security 12 04-05-2007 09:28 PM
Javasript - closing a window djgerbavore Programming 1 05-06-2005 01:01 PM
closing a frozen window!? ungua Linux - Software 6 11-14-2004 01:38 PM
Close window error when not closing firehawk573 Programming 0 03-22-2004 03:05 PM
X-Window Freeze when closing X Session smitchel Linux - Software 3 11-12-2001 11:37 AM


All times are GMT -5. The time now is 07:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration