Unsolved Window not invoking/not displaying when called from inside if block
-
Hello All,
There is one requirement to call two different windows based upon condition placed in if block like..
if(argc == 2 AND argv[1] = 1)
Window1 w1;
w1.show();
else
Window2 w2;
w2.show();If i remove the if-else condition then Window is getting invoked and displaying also.
But when putting the if block then its going in infinite loop and nothing getting displayed.
Kindly suggest how this problem can be solved..Thanks,
Anuj -
@anuj-nogja Please show whole main() content.
Also what does the constructor of the window which is not showing do? Can you show its constructor? -
hi @anuj-nogja ,
if I see that correctly, than you create theWindow1 w1;
and theWindow2 w2;
objects inside theif-brackets
those will be destoyed as soon as the the bracket closes.try this:
Window1 w1; Window2 w2; if(argc == 2 AND argv[1] = 1) { w1.show(); }else{ w2.show(); }