|
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Sun Jan 24, 2010 2:26 am
#close <windowname> |
is there a way to do like a <send href="#close windowname">close window</send> within the window, i tried that exact string and it failed epicly
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Jan 24, 2010 2:38 am |
embed the #close in an #execwin command.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Sun Jan 24, 2010 3:03 am |
like #window clanmember {<send href="#execwin clanmember {#close}">Close Window</send>} or am i doing it wrong? i have never tried to make a link to close a window i just normally click the X but this makes it more pleasing
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Jan 24, 2010 6:01 am |
yep, like that. Perhaps some ~ action and perhaps the "" might not jive so well, just to calm things down. You should be able to ditch the href= part since that's only formally necessary with a simple tag like yours.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Mon Jan 25, 2010 2:53 pm |
#WIN windowname close
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jan 25, 2010 5:59 pm |
Might also be an old bug in the 2.37 version. I just tried the original poster's SEND tag in the 3.12 Beta and it worked fine:
#WINDOW test
#MXP <send href="#close test">close window</send>
Clicking the link properly closed the "test" window. |
|
|
|
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Mon Jan 25, 2010 9:50 pm |
i know that way works fine zugg, but im trying to do it from inside the window it-self which it does not like
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Mon Jan 25, 2010 10:08 pm |
Out of curiosity... whats wrong with the little X in the corner? its a built in feature of every window to close it....
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jan 26, 2010 1:23 am |
The #CLOSE command doesn't allow you to close the window that is issuing the command. There are too many issues dealing with the fact that the script is running in a separate thread and closing the window attached to the thread can cause problems.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Tue Jan 26, 2010 7:40 pm |
would making it send
:%item(%names,1): #CLOSE windowname
work? then it would be telling the main window to close it |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jan 26, 2010 8:25 pm |
Not really. That *might* cause the window to close, but you might also get a crash when CMUD finishes the #CLOSE command and tries to return to the thread attached to the window that you just closed. You'll just have to try it and see what happens.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Jan 28, 2010 11:29 am |
Just had another thought...
#MENU {File|Close window}
i see what you mean about the thread issue... to bad you cant return before the close goes off... an alarm of sorts
:%item(%names,1): #ALA "windowcloser" +0.001 {#CLOSE windowname}
Just tested and this code runs flawlessly.
Code: |
#WIN Test {<send ':%item(%names,1): #ALA "windowcloser" +0.001 {#CLOSE test}' 'Close Window'>Close me!</send>} |
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|