Hi Every one.
In my reservoir rock model project, the color bar at the bottom is zoomed when I apply zoom to the model. Is there any need of SubWindow for color bar? or may it be separated from the model while zooming in or out?

I am placing code so you can understand the problem better.
(key 'i' for zoom in and 'o' for zoom out)
Code :
#include <windows.h> //suitable when using Windows 95/98/NT
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glut.h>
#include <gl/glext.h>
#include <gl/glaux.h>
#include <math.h>
#include <stdlib.h>
#include <dos.h>
// Prototype Decalartion
void myDisplay(void);
void filledCube(GLfloat xLocation, GLfloat yLocation, GLfloat zLocation, GLfloat widthofCube, GLfloat lenghtofCube,  GLfloat heightofCube, GLfloat* fillcolor);
// Variable declaration
GLfloat zoom=10.0;
double P[50]; int counter1=0;  // global variables
GLfloat rX=0, rY=0;
int oldX=0, oldY=0;
void Mouse(int button, int s, int x, int y)
	if (s == GLUT_DOWN) 
		oldX = x; 
		oldY = y; 
void Motion(int x, int y)
	rY += (x - oldX)/5.0f; 
	rX += (y - oldY)/5.0f; 
	oldX = x; 
	oldY = y; 
/////////////////////////// Axis function ///////////////////////////////
void axis(GLfloat length)
{ // draw a axis, with cone at end
		glVertex3d(0, 0, 0); 		 
		glVertex3d(0,0,length); // along the z-axis
	glTranslated(0, 0,length -0.2);
	glutSolidCone(0.04, 0.2, 12, 9);
//////////////////////////// Axis Function end here ////////////////////
///////////////////////////////// bmpfont //////////////////////////////
bitmap_output(GLfloat x, GLfloat y, GLfloat z, char *string, void *font)
  int len, i;
  glRasterPos3f(x, y, z);
  len = (int) strlen(string);
  for (i = 0; i < len; i++) {
    glutBitmapCharacter(font, string[i]);
/////////////////////bmp font end here/////////////////////////////////
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<< displayFunction >>>>>>>>>>>>>>>>>>>>>>
void myDisplay()
	glClear(GL_COLOR_BUFFER_BIT); // clear the screen
	glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
	glMatrixMode(GL_MODELVIEW); // position and aim the camera
	gluLookAt(2.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); /*set camera position*/   
glLoadIdentity ();
glOrtho(-zoom,zoom, -zoom,zoom, -zoom,zoom); /* The camera cube */
//////// QUAD (GRADUATED_COLOR_BAR) start ////////////
     glColor3f(1.0, 1.0, 1.0);
     bitmap_output(-2.2, -8.5, 3.5, "MIN", GLUT_BITMAP_9_BY_15);
     bitmap_output(2.8, -8.5, 1.3, "MAX", GLUT_BITMAP_9_BY_15);
     GLfloat wb=.2, lb=4.8;  // bar length and width
glPushMatrix ();            
     glTranslatef(-1, -8.0, -3); //glTranslatef(1.2, 0.0, 3.2);
     glRotatef (45, 0.0f, 1.0f, 0.0f);
glBegin (GL_QUADS); 
   glColor3f (0.0f, 0.0f, 1.0f); // BLUE COLOR LEFT END 
   glVertex3f (0.0f, wb, 0.0); 
   glVertex3f (0.0f, 0.0f,0.0); 
   glVertex3f (lb/2.0, 0.0,0.0); 
   glVertex3f (lb/2.0, wb,0.0); 
   glVertex3f (lb/2.0, 0.0f,0.0); 
   glVertex3f (lb/2.0, wb,0.0);
   glColor3f (1.0f, 0.0f, 0.0f); //RED COLOR RIGHT END 
   glVertex3f (lb, wb,0.0); 
   glVertex3f (lb, 0.0f,0.0); 
glEnd ();
////////////////// QUAD END///////////////////
    // DRAW AXES      
	glColor3d(1,0,0); // red color
	axis(5); // x-axis
		glRotated(90, 0,1.0, 0);
		glColor3d(0,1,0); //green color
		axis(5); // y-axis
		glRotated(90, 1, 0, 0);
		glColor3d(0,0,1); // blue color
		axis(5); // z-axis
    P[0]=3000; P[1]=2548; P[2]=250; P[3]=2548.9; P[4]=3000;P[5]=500;P[6]=1500;P[7]=2000;P[8]=700;P[9]=2900;	    
    GLdouble PMIN=250, PMAX=3000;
    int N=4;	
    GLfloat j=0.0;
    GLfloat color[4];
            GLfloat avg = (PMAX+PMIN)/2;
            GLfloat avg2 = (avg+PMIN)/2;
            GLfloat avg3 = (avg+PMAX)/2;       
     for (GLint i=0;i<=N; i=i+1)
            if(P[i]>=PMIN &amp;&amp; P[i]<avg){
                color[0]=1-(PMIN/P[i]); color[1]=0.0; color[2]=(PMIN/P[i]); color[3]=1;}
            if(P[i]>=avg &amp;&amp; P[i]<=PMAX){
                color[0]=(P[i]/PMAX); color[1]=0.0; color[2]=1-(P[i]/PMAX); color[3]=1;}
            filledCube(j, 0, 0, .3, .3, .3, color);  //location (x,y,z), size (length, width, height), color (set by array color[] above)
            j=j+0.3; // Translation along X axis
    //////////////////////////////put some text ///////////////////////////////////////
	glColor3f(1.0, 1.0, 1.0);
	 //bitmap_output(2.2, 1.9, 1.5, "simulation viewer", GLUT_BITMAP_HELVETICA_18);
	 bitmap_output(2.2, 0.0, 0.0, "X-AXIS", GLUT_BITMAP_9_BY_15);
	 bitmap_output(0.0, -2.2, 0.0, "Y-AXIS", GLUT_BITMAP_9_BY_15);
	 bitmap_output(0.0, 0.0, 2.2, "Z-AXIS", GLUT_BITMAP_9_BY_15);
//<<<<<<<<<<<<<< display function end >>>>>>>>>>>>>>>
/////////////////////////////////// filledcube function /////////////////////////////////////////
void filledCube(GLfloat xLocation, GLfloat yLocation, GLfloat zLocation, GLfloat widthofCube, GLfloat lenghtofCube,  GLfloat heightofCube, GLfloat* fillcolor) {
GLfloat hWidth  = widthofCube*0.5;
GLfloat hLength = lenghtofCube*0.5;
GLfloat hHeight = heightofCube*0.5;
  glTranslatef(xLocation, yLocation, zLocation);
      //face 1
      glVertex3f(hWidth, hHeight, -hLength); 	 
      glVertex3f(-hWidth, hHeight, -hLength);   
      glVertex3f(-hWidth, hHeight, hLength);    
      glVertex3f(hWidth, hHeight, hLength);    
      //face 2
      glVertex3f(hWidth, hHeight, -hLength);   
      glVertex3f(hWidth, hHeight, hLength);   
      glVertex3f(hWidth , -hHeight, hLength);    
      glVertex3f(hWidth, -hHeight, -hLength); 
      //face 3
      glVertex3f(hWidth, hHeight, hLength);   
      glVertex3f(hWidth, hHeight, hLength);   
      glVertex3f(hWidth, -hHeight, hLength);    
      glVertex3f(hWidth, -hHeight, hLength);
      //face 4
      glVertex3f(hWidth, hHeight, -hLength);   
      glVertex3f(-hWidth, hHeight, -hLength);   
      glVertex3f(-hWidth, -hHeight, -hLength);    
      glVertex3f(hWidth, -hHeight, -hLength);
      //face 5
      glVertex3f(-hWidth , hHeight, -hLength);    
      glVertex3f(-hWidth, hHeight, hLength);    
      glVertex3f(-hWidth, -hHeight, hLength);    
      glVertex3f(-hWidth, -hHeight, -hLength);
      //face 6
      glVertex3f(hWidth, -hHeight, -hLength);   
      glVertex3f(-hWidth, -hHeight, -hLength);   		
      glVertex3f(-hWidth, -hHeight, hLength);   
      glVertex3f(hWidth, -hHeight, hLength);
void keyboard (unsigned char key, int x, int y) {
/* Called when a key is pressed */
if (key == 27) exit (0); /* 27 is the Escape key */
if (key==105) zoom=zoom-.1;
if (key==111) zoom=zoom+.1;
 printf ("Key pressed %c\n", key);
//<<<<<<<<<<<<<<<<<<<<<< main >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
int main(int argc, char** argv){
//printf("Message in Main\n-press i for zoom in\n-o for zoom out\n-'W' indicates a well block");        
glutInit(&amp;argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB );
glutInitWindowPosition(100, 100);
glutCreateWindow("Reservoir Rock Model");
glutDisplayFunc (myDisplay);
glutKeyboardFunc (keyboard); /* Register the "keyboard" function */
glutMouseFunc (Mouse); // register the mouse action function
glutMotionFunc (Motion); // register the mouse action function
glClearColor(0.0f, 0.0f, 0.0f,0.0f); // background is white  Reinitialize the screen
glViewport(0, 0, 700, 600);
return 0;