Here, In the Switch Case I am using some key events.
When I press 0 it directs to Case 0: and goes back to the MainWindow I have, by closing the second-one(Window2). And If I press 1 it directs to Case 1 and so on respectively, where the operations will be executed separatedly.
My key events:
g_printerr("%s\n", gdk_keyval_name (event->keyval));
keypressed=gdk_keyval_name (event->keyval);
printf("The KeyEvent is: %s\n", keypressed);
char ch[10];
sprintf(ch, "%s\n", keypressed);
printf("The NewKeyEvent is: %s\n", ch);
int holdch=atoi(ch);
Switch Case:
switch(holdch)
{
case 0:
printf("Close Window2")
break;
case 1:
printf("Open Quadrant1");
break;
case 2:
printf("Open Quadrant2");
break;
case 3:
printf("Open Quadrant3");
break;
case 4:
printf("Open Quadrant4");
break;
}
Now, I want to close the operations getting run from Case(1-4) when running and come back to the Second window from where it left before.
How to do this? Can another Cases be used inside Case(1-4)? This time I want to use key-buttons like Esc or q for that. Is it possible?
NOTE:
Case 0-> Close the window where I am now and after this there is no chance of executing other cases. As Second Window is the Window containing 4 Quadrants.
Case(1-4)-> All are executable but can be executed one at a time.