|
|
| Author |
Message |
|
|
harinath88 GTK+ Geek
Joined: 30 Jul 2009 Posts: 88
|
Posted: Fri Mar 12, 2010 10:27 am Post subject: closing console |
|
|
hi everybody,
1 . I am hiding the console in windows by using preprocessor.But the problem is if i close the application window ,console is not closing .it is running as background process.
2. Iam calling bellow function in another signal handler .
Problem is if click first time iam unable to see label widget.If click second time i anm able to see label widget .plese tell me if any thing wrong with code.
void give_relavent_message(void)
{
int response;
response = gtk_dialog_run( GTK_DIALOG( Param_widgets.message_dialog));
gtk_label_set_text((GtkLabel*)Param_widgets.message_label,"Please Turn On Main Power Supply ");
gtk_widget_hide(Param_widgets.dialog_pw_prf);
return 0;
}
Can any one help me out from this problem.
Thanks and Regards,
Harinath reddy. |
|
| Back to top |
|
 |
tadeboro Never Seen the Sunlight
Joined: 23 Jul 2008 Posts: 2114 Location: Slovenia
|
Posted: Fri Mar 12, 2010 6:39 pm Post subject: |
|
|
Hello.
First problem is probably caused by not calling gtk_main_quit)( when application should end. Usually, this is done like this:
| Code: (C) | 1 2
| g_signal_connect( G_OBJECT( window ), "destroy",
G_CALLBACK( gtk_main_quit ), NULL ); |
As for the second problem, code fragment that you showed should work properly, but in order to be sure, you would need to provide more context (where is dialog created, where is label created, ...).
Tadej |
|
| Back to top |
|
 |
harinath88 GTK+ Geek
Joined: 30 Jul 2009 Posts: 88
|
Posted: Mon Mar 15, 2010 4:14 am Post subject: |
|
|
Hi Tadeji,
Thanque very much for your kind info .
1. Iam using Glade3 ,so if i use
gtk_builder_connect_signals(Param_widgets.GTKApp,NULL); api it will take care of those signals is my openion.
2 . I have created label in the dialog box only.
To the dialog box i added layout widget ,then to the layout widget label widget was added.
Thanks & Regards,
Harinath. |
|
| Back to top |
|
 |
tadeboro Never Seen the Sunlight
Joined: 23 Jul 2008 Posts: 2114 Location: Slovenia
|
Posted: Wed Mar 17, 2010 1:05 pm Post subject: |
|
|
Hi.
| harinath88 wrote: | 1. Iam using Glade3 ,so if i use
gtk_builder_connect_signals(Param_widgets.GTKApp,NULL); api it will take care of those signals is my openion. |
This function will only take care of terminating main loop if you connected "GtkObject::destroy" signal to gtk_main_quit function in toplevel window's signals tab. This is not done automatically otherwise.
| harinath88 wrote: | 2 . I have created label in the dialog box only.
To the dialog box i added layout widget ,then to the layout widget label widget was added. |
This still isn't enough info to pinpoint the problem. Try providing some simple, compilable code that displays this problem and I'm almost sure that during this process, you'll find the solution yourself.
Tadej |
|
| Back to top |
|
 |
harinath88 GTK+ Geek
Joined: 30 Jul 2009 Posts: 88
|
Posted: Thu Mar 18, 2010 4:15 am Post subject: |
|
|
Hi Tadeji,
Thanks for kind reply .
1. Now i am able to close tha console window when i close the application .i followed your suggetion.
2. Instead creating dialog statically iam creating dynamically ,for time being it is helping me.But problem if i do like that i need to use STOCK icons ,i cont use my own icons there.Any way not an isssue.
3. Some times my applcation gets stuck.In my applcaiton i used
g_thread_create to receive udp packet continueously.Remaining thresds are using gdk_threads..........
I know gtk is not thread safe,but i dont have other option.
colud u give me any reasons to stuck.I will look into them and make them correct.
Thanks & Regards
Harianth. |
|
| Back to top |
|
 |
tadeboro Never Seen the Sunlight
Joined: 23 Jul 2008 Posts: 2114 Location: Slovenia
|
Posted: Fri Mar 19, 2010 11:42 pm Post subject: |
|
|
Hello.
You only need to use gdk_treads_() macros if you call GTK+ functions from multiple threads (which you really shouldn't). I would suggest you to only use GLib from multiple threads (GLib is thread safe once you call g_thread_init()) and only schedule GUI updates into main thread using g_idle_add().
Tadej |
|
| Back to top |
|
 |
|