Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
i'm trying to launch a window from a keymapped button and have a script run after the window is launched. i can do this with the <onfocus> command for the default button. i then want the window to close when the script ends. i do this with a replacewindow() call.
this works well with a type window. with type dialog the window stays open even if i use a replacewindow() call and type buttonmenu closes the first time i do anything in the script.
1. is there a visible command i could use to force a buttonmenu type window to stay open and not reload?
2. does and/or can there be an additional method added to python to force a type dialog window to close?
3. it would work smoother if there was a way to close a type dialog window from python.
4. did i completely miss something.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
i assume the dialog is not under python's control (ie you have started it via a custom xml file?)
what about trying to send it a "previousmenu" or "close" action via httpapi - will that do the trick? if so, then we could take that code and use it for a built in. seems the easiest way around.
cheers,
jonathan
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
sending a command with httpapi would work.
are you saying a command already exists or would one have to be coded.
i see a sendkey command maybe that would work. i'll experiment with it.
thanks
edit: sendkey doesn't work, but a httpapi command that could take a windowid argument should work fine.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
hmm, not sure why sendkey wouldn't work - is there another dialog up that gets priority or something? or maybe it's because the dialog didn't handle that key action for some reason (i assume it has no keymap entry, so the global action would have been used).
i think there was one where you could send an action id direct (or maybe even an action string?) - that may be a solution.
cheers
jonathan
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
oops, sendkey does work, it's code 275.
i thought there was a way to execute these without the web server running.
i'll play around with it.
thanks for your help.
edit: to clear things up. your right there is no keymap entry for this dialog and the dialog is not under the control of python.
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
well, this probably isn't going to work well.
there are other circumstances when a dialog window is open and you need it to close on an activatewindow() or replacewindow() call from the skin itself. if for example you have a window keymapped.
i'm still puzzled on what i read. i thought the webserver did not have to be running for these http commands. i know there http, but what the heck did i read. i can't find it know.
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
i knew i read something about that. i see your post asking, but missed his reply. maybe i'm blind.
do you have his post where he stated it did not have to be enabled.
i could not get sendkey to work without it running.
Posts: 363
Joined: Jun 2004
Reputation:
0
well the executehttpapi was implanted after i requested a way to execute the api, and not have to worrie about if the webserver was on. so if there is something not working, it must be a bug somewhere. (or the httpapidev was unable to code all of the commands to be webserver off safe)
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
well, i'm not crazy. some commands do work without the webserver running. (good news)
sendkey however does not. i'm not sure if that can be implemented without the server running or not.
Posts: 258
Joined: Dec 2005
Reputation:
0
can anybody confirm for me if the sendkey ascii values is working right now or not? i'm picking at and looking everywhere for a solution, but i can't get the web service to recognize keystroke values.
if anybody has any info on this that would be immaculate.
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
sendkey using executehttpapi in python works as long as the web server is running.
what are you trying to send and how?
Posts: 258
Joined: Dec 2005
Reputation:
0
i'm not using python, i'm sending the command from my computer on the network.
i have no problem sending any command accept keystrokes thru sendkey, any suggestions?