|
|
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to call GUI in static function?
How to call GUI in static function? [message #12785] |
Fri, 16 November 2007 09:36 |
LiniX
Messages: 7 Registered: October 2007 Location: Thailand
|
Promising Member |
|
|
Hi,
i have a little problem.
in my static function (static void Project::on_call()).
this static function is active when have someone call to me.
(i make Softphone)
when have someone call to me, i want the popup window to show who call to me and show "Accept" or "Reject" like X-Lite or Skype.
So..
static void Project::on_call(){
//CODES
if(PromptOKCancel("Accept?")){
/* answer incoming calls with 200/OK */
pjsua_call_answer(call_id, 200, NULL, NULL);
}
}
it build complete, But when i use program when someone call to me, the programe is crash. and it say
(<unknown>:7856): Gdk-CRITICAL **: gdk_pixmap_foreign_new_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(<unknown>:7856): Gdk-CRITICAL **: gdk_drawable_set_colormap: assertion `GDK_IS_DRAWABLE (drawable)' failed
(<unknown>:7856): Gdk-CRITICAL **: gdk_drawable_get_depth: assertion `GDK_IS_DRAWABLE (drawable)' failed
(<unknown>:7856): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed
(<unknown>:7856): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Segmentation fault (core dumped)
and Program is crash.
sometime is
Xlib: unexpected async reply (sequence 0x20a7)!
GUI is crash but function is working
so i use Layout to static function
in Project.h
class Project : public WithTopLayout<TopWindow>{
WithAccountLayout<TopWindow> account;
WithRingLayout<TopWindow> ringer;
...
...
static void Project::on_call(){
//CODES
ringer.Execute();
but build incomplete, it say
...
/home/watchara/upp/MyApps/Project/Project.h:19: error: invalid use of member ‘Project::ringer’ in static member function
/home/watchara/upp/MyApps/Project/Project.cpp:62: error: from this location
...
How to use PromptOKCancel,Layout in static function ?
Thank You Very Much
Watchara Kangkun
Stupid Man
|
|
|
Re: How to call GUI in static function? [message #12786 is a reply to message #12785] |
Fri, 16 November 2007 11:55 |
|
mirek
Messages: 13980 Registered: November 2005
|
Ultimate Member |
|
|
LiniX wrote on Fri, 16 November 2007 03:36 | Hi,
i have a little problem.
in my static function (static void Project::on_call()).
this static function is active when have someone call to me.
(i make Softphone)
when have someone call to me, i want the popup window to show who call to me and show "Accept" or "Reject" like X-Lite or Skype.
So..
static void Project::on_call(){
//CODES
if(PromptOKCancel("Accept?")){
/* answer incoming calls with 200/OK */
pjsua_call_answer(call_id, 200, NULL, NULL);
}
}
it build complete, But when i use program when someone call to me, the programe is crash. and it say
(<unknown>:7856): Gdk-CRITICAL **: gdk_pixmap_foreign_new_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(<unknown>:7856): Gdk-CRITICAL **: gdk_drawable_set_colormap: assertion `GDK_IS_DRAWABLE (drawable)' failed
(<unknown>:7856): Gdk-CRITICAL **: gdk_drawable_get_depth: assertion `GDK_IS_DRAWABLE (drawable)' failed
(<unknown>:7856): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed
(<unknown>:7856): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Segmentation fault (core dumped)
and Program is crash.
sometime is
Xlib: unexpected async reply (sequence 0x20a7)!
GUI is crash but function is working
so i use Layout to static function
in Project.h
class Project : public WithTopLayout<TopWindow>{
WithAccountLayout<TopWindow> account;
WithRingLayout<TopWindow> ringer;
...
...
static void Project::on_call(){
//CODES
ringer.Execute();
but build incomplete, it say
...
/home/watchara/upp/MyApps/Project/Project.h:19: error: invalid use of member ‘Project::ringer’ in static member function
/home/watchara/upp/MyApps/Project/Project.cpp:62: error: from this location
...
How to use PromptOKCancel,Layout in static function ?
Thank You Very Much
Watchara Kangkun
Stupid Man
|
I am sorry, the description is far confusing. Do you think you could create a simple testcase to demonstrate the problem?
Mirek
|
|
|
|
|
Goto Forum:
Current Time: Wed May 15 04:24:28 CEST 2024
Total time taken to generate the page: 0.02021 seconds
|
|
|