Skip to main content
Known Participant
December 8, 2009
Question

window opens up fine just first time... in Vista

  • December 8, 2009
  • 1 reply
  • 488 views

Hi, I am encountering a very strange problem just on Vista (on XP works fine):
I have created a window1 and window2. Also a button in window1 and in the button.onClick() function I put the window2.show().
Now, the first time the user clicks on the button, window2 appears with all elements inside. If the user closes it and click again on the button, a bigger and completely empty window appears....


On Windows XP this does not happen and every time I click on the button, the window appear with its content.

What could it be? What to look at? I have no idea.

Many thanks

Giuseppe

This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
December 8, 2009

What I normally do is to put the second window in a function and call that.

I have updated to windows 7 so can't test Vista, windows 7 works ok using your method though.


var win1 =  new Window( 'dialog', 'Window ONE' );
var win2 =  new Window( 'dialog', 'Window TWO' );
win1.win2 = win1.add( 'button', undefined, 'win2', { name:'Window 2' });
win1.cancelBtn = win1.add( 'button', undefined, 'Cancel', { name:'cancel' });
win2.cancelBtn = win2.add( 'button', undefined, 'Cancel', { name:'cancel' });
win1.center();
win2.center();
win1.win2.onClick = function(){
win2.show();
}
win1.show();

Known Participant
December 14, 2009

Hi Paul, thanks but this exact script works perfectly on my Windows XP with CS3 and shows the same error (the second time that the button is pressed, the window2 opens up big and blank) on my Windows 7 with CS4.... it seems impossible but it's the truth.

Anyone can try on Vista/7 and check? What can it be?

thanks

Giuse

Paul Riggott
Inspiring
December 14, 2009

Could you please try this version ...


var win1 =  new Window( 'dialog', 'Window ONE' );
win1.win2 = win1.add( 'button', undefined, 'win2', { name:'Window 2' });
win1.cancelBtn = win1.add( 'button', undefined, 'Cancel', { name:'cancel' });
win1.center();

win1.win2.onClick = function(){
screen2();
}
win1.show();
function screen2(){
var win2 =  new Window( 'dialog', 'Window TWO' );
win2.cancelBtn = win2.add( 'button', undefined, 'Cancel', { name:'cancel' });
win2.center();
win2.show();
}