Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
LiniX is currently offline  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
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Have the PictureButton ?
Next Topic: Using RichEdit in dialog
Goto Forum:
  


Current Time: Tue May 14 19:42:46 CEST 2024

Total time taken to generate the page: 0.02513 seconds