Commit a8d8762f authored by saeed's avatar saeed

moving window

parent 58c04880
static void movewindow(struct Vis *vis, int x, int y){
XMoveWindow(vis->dsp, vis->win, x, y);
}
static void colortoRGBA(uint32 color, uint8 *red, uint8 *green, uint8 *blue, uint8 *alpha){
*red = 0x0;
......@@ -80,9 +84,12 @@ static struct Vis init_x(int w, int h){
result.fontinfo = XLoadQueryFont (result.dsp, fontname);
if (! result.fontinfo) {
fprintf (stderr, "unable to load font %s: using fixed\n", fontname);
fontname = "10x20";
result.fontinfo = XLoadQueryFont(result.dsp,"10x20");
if (! result.fontinfo){
result.fontinfo = XLoadQueryFont (result.dsp, "fixed");
fprintf (stderr, "unable to load font %s: using \n",fontname);
fontname = "fixed";
result.fontinfo = XLoadQueryFont (result.dsp, fontname);
}
}
result.gr_values.font = result.fontinfo->fid;
......@@ -98,7 +105,7 @@ static struct Vis init_x(int w, int h){
// say window manager which position we would prefer
XSizeHints sizehints ;
sizehints.flags = USPosition | USSize ;
sizehints.x = 200 ; sizehints.y = 200 ;
sizehints.x = 100 ; sizehints.y = 100 ;
sizehints.width = w ; sizehints.height = h ;
XSetWMNormalHints( result.dsp, result.win, &sizehints ) ;
return result;
......
......@@ -177,6 +177,8 @@ int main(int argc, char *argv[]){
map_window(&visu_1);
map_window(&visu);
movewindow(&visu,(int)(WIDTH_TR1*1.01),0);
pthread_t thread_id[NUM_THREADS];
for (int i=0; i < NUM_THREADS;++i){
pthread_create(&thread_id[i], NULL, handle_event_thread, (void *)&visu_1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment