cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

stop close window

jiy
1-Newbie
1-Newbie

stop close window



Adepters,



I want to re-confirm when user close a window using X
button. I add winQuitCallback function to my window. In this function I
ask user if he want to close window or not. If user chooses yes then I
close window. Otherwise this window should not be closed. But it seams
that nomatter I return 0 or -1, the window always is closed. Can anybody
show me how to stop window close?








Thanks,



Yan











5 REPLIES 5
lynn
1-Newbie
(To:jiy)

<br /><br />Yan,<br /><br /><br /><br /><br /><br /><br /><br />The best I can tell you on this one is to<br />go back about three or four years ago in the archive. Look for posts by Paul<br />Klock on this topic (or closing using the ‘x’ button). <br /><br /><br /><br /><br /><br /><br /><br />As I recall, there is a way to do this,<br />but it is some fairly serious work. The ‘x’ in the Window is not<br />controlled by Epic, but by the OS and thus you need to capture that action for<br />the callback to function.<br /><br /><br /><br /><br /><br /><br /><br />Lynn<br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /> <br /><br />From: Ji, Yan<br /> <br /><br />Sent: Saturday, September 09, 2006<br />2:33 PM<br /><br />To: arbortext-adepters<br /><br />Subject: stop close window<br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /> <br /><br />&lt;font&lt;br/&gt;size=2 face=Arial&gt;Adepters,<br /><br /><br /><br />&lt;font&lt;br/&gt;size=2 face=Arial&gt; I<br />want to re-confirm when user close a window using X button. I add<br />winQuitCallback function to my window. In this function I ask user if he want<br />to close window or not. If user chooses yes then I close window.<br />Otherwise this window should not be closed. But it seams that nomatter I<br />return 0 or -1, the window always is closed. Can anybody show me how to<br />stop window close?<br /><br /><br /><br />&lt;font&lt;br/&gt;size=2 face=Arial&gt;<br /><br /><br /><br />&lt;font&lt;br/&gt;size=2 face=Arial&gt;Thanks,<br /><br /><br /><br />&lt;font&lt;br/&gt;size=2 face=Arial&gt;Yan<br /><br /><br /><br />&lt;font&lt;br/&gt;size=2 face=Arial&gt;<br /><br /><br /><br />&lt;font&lt;br/&gt;size=2 face=Arial&gt;<br /><br /><br /><br /> <br /><br />&gt;&gt; To unsubscribe from the list, send an email to<br />listmanager@maillist.arbortext.com with the following in the body: unsubscribe<br />adepters - For additional information on the adepters list (how to subscribe or<br />unsubscribe etc), send an email to: listmanager@maillist.arbortext.com with the<br />following in the body: info Adepters - You may also go to forums.arbortext.com,<br />enter the Adepters folder and change your subscription options and<br />preferences.&gt;&gt; <br /><br /><br /><br />

ebenton
1-Newbie
(To:jiy)

Back three or four years ago, was Epic using the old Galaxy
interface or the current Windoze interface? Things might be different now,
witha differentversion of Epic/Arbortext
Editor.





From: Lynn Hales

Sent: Sunday, September 10, 2006 9:03 PM
To:
adepters@arbortext.com
Subject: RE: stop close
window




style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Yan,


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The best I can tell you
on this one is to go back about three or four years ago in the archive.
Look for posts by Paul Klock on this topic (or closing using the 'x'
button).



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">As I recall, there is a
way to do this, but it is some fairly serious work. The 'x' in the Window
is not controlled by Epic, but by the OS and thus you need to capture that
action for the callback to function.



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Lynn


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">





style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From: face=Tahoma size=2> Saturday, September 09, 2006 2:33
PM
Subject:
stop close window


style="FONT-SIZE: 12pt">



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Adepters,





style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks,





style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">


style="FONT-SIZE: 12pt">>> To unsubscribe from the list, send an email to
listmanager@maillist.arbortext.com with the following in the body: unsubscribe
adepters - For additional information on the adepters list (how to subscribe or
unsubscribe etc), send an email to: listmanager@maillist.arbortext.com with the
following in the body: info Adepters - You may also go to forums.arbortext.com,
enter the Adepters folder and change your subscription options and
preferences.>>


>> To unsubscribe from the
list, send an email to listmanager@maillist.arbortext.com with the following in
the body: unsubscribe adepters - For additional information on the adepters list
(how to subscribe or unsubscribe etc), send an email to:
listmanager@maillist.arbortext.com with the following in the body: info Adepters
- You may also go to forums.arbortext.com, enter the Adepters folder and change
your subscription options and preferences.>>
lhales
1-Newbie
(To:jiy)

Ed,

As I recall from the thread back then, for the Windoze 'x' it was the
Macro$carf interface. This is one of those pieces of the window that is
OS and not application run. There may be some leeway in what appears in
the title bar, but not much. Changing the icon for the window drop down,
a unique window title and the number of buttons at the right. Even the
'window_create' function does not allow me to change things in the title
bar.

Lynn

Try this:

package myQuit

function window_quit_callback (win, code) {
response("win is $win, code is $code");
$res = response("quit", "yes", "no");
if ($res == 2) {
return -1
}
return 0
}

function session_quit_callback (code) {
response("code is $code");
$res = response("quit", "yes", "no");
if ($res == 2) {
return -1
}
return 0
}

window_set(current_window(), 'quitCallback',
'myQuit::window_quit_callback');
session_add_callback('quit', 'myQuit::session_quit_callback');


The window_quit_callback takes care of non-primary epic windows, and the
session_quit_callback takes care of the primary window.

Steve

Ji, Yan wrote:
>
> Adepters,
>
> I want to re-confirm when user close a window using X button. I add
> winQuitCallback function to my window. In this function I ask user if
> he want to close window or not. If user chooses yes then I close
> window. Otherwise this window should not be closed. But it seams that
> nomatter I return 0 or -1, the window always is closed. Can anybody
> show me how to stop window close?
>
>
>
> Thanks,
>
> Yan
>
>
>
>
>
jiy
1-Newbie
1-Newbie
(To:jiy)

This code works. Thank you Steve, Lynn and Ed.

Yan Ji
Announcements