예제 #1
0
static PyObject *
forms_getmcolor(PyObject *self, PyObject *args)
{
	int arg;
	short r, g, b;

	if (!PyArg_Parse(args, "i", &arg)) return NULL;

	fl_getmcolor(arg, &r, &g, &b);

	return Py_BuildValue("(hhh)", r, g, b);
}
예제 #2
0
파일: cursor.c 프로젝트: OrangeTide/xforms
void
fl_set_cursor_color( int      name,
                     FL_COLOR fg,
                     FL_COLOR bg )
{
    XColor xfg,
           xbg;
    int r,
        g,
        b;
    Cursor cur = fli_get_cursor_byname( name );

    fl_getmcolor( fg, &r, &g, &b );
    xfg.red   = ( r << 8 ) | 0xff;
    xfg.green = ( g << 8 ) | 0xff;
    xfg.blue  = ( b << 8 ) | 0xff;

    fl_getmcolor( bg, &r, &g, &b );
    xbg.red   = ( r << 8 ) | 0xff;
    xbg.green = ( g << 8 ) | 0xff;
    xbg.blue  = ( b << 8 ) | 0xff;

    XRecolorCursor( flx->display, cur, &xfg, &xbg );
}