Page 1 of 1

Open and CloseDisplay() question....

Posted: Thu Apr 15, 2010 12:33 am
by Tuxedo
Hi ALL!

In my program I've code that create, write on, and open a display to show some infos...
Since now no peobs but...
When I go to close the new display with the close gadget it will close all the program...
I've installed an event handler to check for "CloseWindow" but it was triggerd only when I close the main display...
It seems to me really weird...any idea on what I miss?

my code was:

CreateDisplay(2, { Width = 350, Height = 170, Color = $F0F0F0, NoHide = TRUE, Hidden = TRUE, Title = "Info file", Sizeable = FALSE }) ; Creo il mio Display che conterrĂ  i dati Exif

SelectDisplay(2)

LOCAL q = 0

FOR LOCAL TAGPos = 1 TO 14
IF (TAGName[TAGPos] <> "") AND (ToString(TAGVAlue[TAGPos]) <> "99") AND (ToString(TAGVAlue[TAGPos]) <> "0")
TextOut(1, (1+((TAGPos-1-q)*12)), TAGName[TAGPos])
TextOut(88, (1+((TAGPos-1-q)*12)), TAGValue[TAGPos] .. "\n")
ELSE
q = q + 1
EndIF
NEXT

EndSelect()

OpenDisplay(2)

Really dunno what I made wrong...sorry!

Thank all for help!

Re: Open and CloseDisplay() question....

Posted: Thu Apr 15, 2010 8:20 am
by Allanon
Try installing the event handler on close window event when the Display 2 is active, in this way you will attach the event handler to the display 2, many events works in this way, like for the resize event and the move event.
This way you can "trap" the close event in your function and you can manually close the display or make whatever you want :)

Greets,
Fabio

Re: Open and CloseDisplay() question....

Posted: Thu Apr 15, 2010 11:37 pm
by Tuxedo
Thank you!
Now all works pretty well and I LOVE that new windows!
Was really "proof" now to have more than one window opened togheter and that works togheter :)