GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to run only a dialog window and run only a program?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
sunrain988
Familiar Face


Joined: 17 Jul 2008
Posts: 13

PostPosted: Tue Oct 07, 2008 4:38 am    Post subject: How to run only a dialog window and run only a program? Reply with quote

I wrote a program with GTK.It run an About dialog when I clicked the About dialog every times.How can I run only a dialog window or program whenever I click the menuitem or program.
Back to top
ramesh
GTK+ Guru


Joined: 16 Nov 2006
Posts: 270
Location: INDIA

PostPosted: Tue Oct 07, 2008 5:20 am    Post subject: Re: How to run only a dialog window and run only a program? Reply with quote

sunrain988 wrote:
I wrote a program with GTK.It run an About dialog when I clicked the About dialog every times.How can I run only a dialog window or program whenever I click the menuitem or program.


use
Quote:

gtk_window_set_modal (GTK_WINDOW (About_dialog), TRUE);


or

Quote:

void
on_about_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
if(About_dialog==NULL)
gtk_widget_show (About_dialog);
}
Back to top
sunrain988
Familiar Face


Joined: 17 Jul 2008
Posts: 13

PostPosted: Tue Oct 07, 2008 8:09 am    Post subject: Thank you Reply with quote

Thank you.
but I still can't solve it.
Back to top
tadeboro
Never Seen the Sunlight


Joined: 23 Jul 2008
Posts: 2114
Location: Slovenia

PostPosted: Tue Oct 07, 2008 8:33 am    Post subject: Re: How to run only a dialog window and run only a program? Reply with quote

sunrain988 wrote:
I wrote a program with GTK.It run an About dialog when I clicked the About dialog every times.How can I run only a dialog window or program whenever I click the menuitem or program.
I don't quite understand what are you trying to do here. Do you wish to hide main window when showing dialog? Please try to explain a little more.
Back to top
sunrain988
Familiar Face


Joined: 17 Jul 2008
Posts: 13

PostPosted: Tue Oct 07, 2008 10:36 am    Post subject: Thanks Reply with quote

Thanks.
I have solved it with Modal Dialog.But,I still have not solved it with NonModal Dialog.I want to get only one Dialog whenever I click the "about" menuitem.
Others,I don't know how to write a program and execute the program,only one process,only one icon in the system tray.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP