class Fox::FXObject
FXObject is the base class for all objects in FOX; in order to receive messages from the user interface, your class must derive from FXObject. The FXObject class also provides serialization facilities, with which you can save and restore the object’s state. If you’ve subclassed from FXObject, you can save your subclasses’ state by overloading the save() and load() functions and use the stream API to serialize its member data.
Public Class Methods
Source
SWIGINTERN VALUE
_wrap_new_FXObject(int argc, VALUE *argv, VALUE self) {
FXObject *result = 0 ;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
{
result = (FXObject *)new_FXObject();
DATA_PTR(self) = result; FXRbRegisterRubyObj(self, result);
if(rb_block_given_p()){
rb_yield(self);
}
}
return self;
fail:
return Qnil;
}
Source
# File lib/fox16/core.rb, line 591 def self.subclasses ObjectSpace.enum_for(:each_object, class << self; self; end).to_a end
Public Instance Methods
Source
# File lib/fox16/tkcompat.rb, line 8 def bind(str, pr) tokens = str.split('-') modifiers = [] type = nil detail = nil case type when "Button" when "ButtonPress" connect(SEL_LEFTBUTTONPRESS, pr) when "ButtonRelease" connect(SEL_LEFTBUTTONRELEASE, pr) when "Configure" connect(SEL_CONFIGURE, pr) when "Deactivate" when "Destroy" connect(SEL_DESTROY, pr) when "Enter" connect(SEL_ENTER, pr) when "Expose" connect(SEL_PAINT, pr) when "FocusIn" connect(SEL_FOCUSIN, pr) when "FocusOut" connect(SEL_FOCUSOUT, pr) when "Key" when "KeyPress" connect(SEL_KEYPRESS, pr) when "KeyRelease" connect(SEL_KEYRELEASE, pr) when "Leave" connect(SEL_LEAVE, pr) when "Motion" connect(SEL_MOTION, pr) when "Map" connect(SEL_MAP, pr) when "Unmap" connect(SEL_UNMAP, pr) when "Activate" when "Circulate" when "Colormap" when "Gravity" when "Property" when "Reparent" when "Visibility" raise NotImplementedError end end
Source
SWIGINTERN VALUE
_wrap_FXObject_handle(int argc, VALUE *argv, VALUE self) {
FXObject *arg1 = (FXObject *) 0 ;
FXObject *arg2 = (FXObject *) 0 ;
FXSelector arg3 ;
void *arg4 = (void *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
long result;
VALUE vresult = Qnil;
if ((argc < 3) || (argc > 3)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXObject, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXObject *","handle", 1, self ));
}
arg1 = reinterpret_cast< FXObject * >(argp1);
res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_FXObject, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXObject *","handle", 2, argv[0] ));
}
arg2 = reinterpret_cast< FXObject * >(argp2);
arg3 = NUM2UINT(argv[1]);
arg4 = FXRbGetExpectedData(self, arg3, argv[2]);
result = (long)(arg1)->handle(arg2,arg3,arg4);
vresult = SWIG_From_long(static_cast< long >(result));
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXObject_load(int argc, VALUE *argv, VALUE self) {
FXObject *arg1 = (FXObject *) 0 ;
FXStream *arg2 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXObject, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXObject *","load", 1, self ));
}
arg1 = reinterpret_cast< FXObject * >(argp1);
res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_FXStream, 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXStream &","load", 2, argv[0] ));
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "FXStream &","load", 2, argv[0]));
}
arg2 = reinterpret_cast< FXStream * >(argp2);
FXObject_load(arg1,*arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXObject_save(int argc, VALUE *argv, VALUE self) {
FXObject *arg1 = (FXObject *) 0 ;
FXStream *arg2 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXObject, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXObject const *","save", 1, self ));
}
arg1 = reinterpret_cast< FXObject * >(argp1);
res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_FXStream, 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXStream &","save", 2, argv[0] ));
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "FXStream &","save", 2, argv[0]));
}
arg2 = reinterpret_cast< FXStream * >(argp2);
FXObject_save((FXObject const *)arg1,*arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXObject_tryHandle(int argc, VALUE *argv, VALUE self) {
FXObject *arg1 = (FXObject *) 0 ;
FXObject *arg2 = (FXObject *) 0 ;
FXSelector arg3 ;
void *arg4 = (void *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int res4 ;
long result;
VALUE vresult = Qnil;
if ((argc < 3) || (argc > 3)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXObject, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXObject *","tryHandle", 1, self ));
}
arg1 = reinterpret_cast< FXObject * >(argp1);
res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_FXObject, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXObject *","tryHandle", 2, argv[0] ));
}
arg2 = reinterpret_cast< FXObject * >(argp2);
arg3 = NUM2UINT(argv[1]);
res4 = SWIG_ConvertPtr(argv[2],SWIG_as_voidptrptr(&arg4), 0, 0);
if (!SWIG_IsOK(res4)) {
SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "void *","tryHandle", 4, argv[2] ));
}
result = (long)(arg1)->tryHandle(arg2,arg3,arg4);
vresult = SWIG_From_long(static_cast< long >(result));
return vresult;
fail:
return Qnil;
}