var factory = new net.HTTPRequestHandlerFactory();
factory.createRequestHandler = function(request)
{
var handler = new
net.HTTPRequestHandler();
handler.handleRequest =
function(request, response)
{
// doing something at this level
}
glue.server = new net.HTTPServer(factory, new
net.ServerSocket(glueServerSocket), new net.HTTPServerParams());
glue.server.start();
And you are making a desktop type app in the browser (great
advantages) that uses server calls,and you want wxwidgets to appear
from within the type of area shown above, is there a stable way of
using top level functions like:
myWx = require("wx");
I've tried
myWx = glue.require("wx");
And
myWx.messageBox("hello from deep function"); works fine, but does not
come to front of screen.
This works ... but
Is it correct/stable, in strict ECMA I expect it to be.
Also, can there be more than one wx object that calls ...
myWx.theApp.onInit = function(){}
... Per / script?
Or are we limited to one object only per script being able to use
dahDah.theApp.onInit = dahdaH
Specifically I have a switch statement which acts on the server
request information, here is a segment. I have run the contents of the
case statement below as a standalone GLUEscript and it works fine -
changing/removing " response. " as appropriate.
case 'navigate':
//response.contentType="text/plain";
//response.print("List Will be here");
// above response(s) test fine
var wxImagDir = glue.require("wx");
wxImagDir.initAllImageHandlers();
wxImagDir.theApp.onInit = function(){ // none of this seems to work
var simple = new wxImagDir.Frame(null, wxImagDir.Id.ANY, "Choose
Directory");
var panel = new wxImagDir.Panel(simple, wxImagDir.Id.ANY);
var button = new wxImagDir.Button(panel, wxImagDir.Id.ANY,
"Choose Image Directory", { x : 40, y : 50 });
var buttonClose = new wxImagDir.Button(panel, wxImagDir.Id.EXIT, "",
{ x : 290, y : 180 });
var showText = new wxImagDir.StaticText(panel, wxImagDir.Id.ANY, "",
{ x : 20, y : 20 });
showText.wrap = 200;
showText.label = "Please Choose The Directory You Wish to Work
with:";
button.onClicked = function(){
var getDir = new wxImagDir.DirDialog(simple,
"Choose Image Directory",
"",
wxImagDir.DirDialog.DEFAULT_STYLE,
wxImagDir.DefaultPosition); //
response.contentType="text/plain";
response.print(glue.getDir.path); // as theApp.onInit does not appear
to fire, this: TypeError: glue.getDir is undefined
wxImagDir.messageBox("hello from deep function"); // works fine if
above line REMed out, but does not come to front of screen
I don't think it's a good idea to mix wx code and other multithreaded
code (the server socket code is run in another thread then the main
thread). There's only one theApp variable in a script. onInit is only
called before the wx-application enters the mainloop. So changing this
function has no effect.
Franky
On 15 okt, 02:47, PaulANormanNZ <paul.a.nor...@gmail.com> wrote:
> var factory = new net.HTTPRequestHandlerFactory();
> factory.createRequestHandler = function(request)
> {
> var handler = new
> net.HTTPRequestHandler();
> handler.handleRequest =
> function(request, response)
> {
> // doing something at this level
> }
> glue.server = new net.HTTPServer(factory, new
> net.ServerSocket(glueServerSocket), new net.HTTPServerParams());
> glue.server.start();
> And you are making a desktop type app in the browser (great
> advantages) that uses server calls,and you want wxwidgets to appear
> from within the type of area shown above, is there a stable way of
> using top level functions like:
> myWx = require("wx");
> I've tried
> myWx = glue.require("wx");
> And
> myWx.messageBox("hello from deep function"); works fine, but does not
> come to front of screen.
> This works ... but
> Is it correct/stable, in strict ECMA I expect it to be.
> Also, can there be more than one wx object that calls ...
> myWx.theApp.onInit = function(){}
> ... Per / script?
> Or are we limited to one object only per script being able to use
> dahDah.theApp.onInit = dahdaH
> Specifically I have a switch statement which acts on the server
> request information, here is a segment. I have run the contents of the
> case statement below as a standalone GLUEscript and it works fine -
> changing/removing " response. " as appropriate.
> case 'navigate':
> //response.contentType="text/plain";
> //response.print("List Will be here");
> // above response(s) test fine
> var wxImagDir = glue.require("wx");
> wxImagDir.initAllImageHandlers();
> wxImagDir.theApp.onInit = function(){ // none of this seems to work
> var simple = new wxImagDir.Frame(null, wxImagDir.Id.ANY, "Choose
> Directory");
> var panel = new wxImagDir.Panel(simple, wxImagDir.Id.ANY);
> var button = new wxImagDir.Button(panel, wxImagDir.Id.ANY,
> "Choose Image Directory", { x : 40, y : 50 });
> var buttonClose = new wxImagDir.Button(panel, wxImagDir.Id.EXIT, "",
> { x : 290, y : 180 });
> var showText = new wxImagDir.StaticText(panel, wxImagDir.Id.ANY, "",
> { x : 20, y : 20 });
> showText.wrap = 200;
> showText.label = "Please Choose The Directory You Wish to Work
> with:";
> response.contentType="text/plain";
> response.print(glue.getDir.path); // as theApp.onInit does not appear
> to fire, this: TypeError: glue.getDir is undefined
> wxImagDir.messageBox("hello from deep function"); // works fine if
> above line REMed out, but does not come to front of screen
> I don't think it's a good idea to mix wx code and other multithreaded > code (the server socket code is run in another thread then the main > thread). There's only one theApp variable in a script. onInit is only > called before the wx-application enters the mainloop. So changing this > function has no effect.
> > var factory = new net.HTTPRequestHandlerFactory(); > > factory.createRequestHandler = function(request) > > { > > var handler = new > > net.HTTPRequestHandler(); > > handler.handleRequest = > > function(request, response) > > {
> > // doing something at this level
> > } > > glue.server = new net.HTTPServer(factory, new > > net.ServerSocket(glueServerSocket), new net.HTTPServerParams()); > > glue.server.start();
> > And you are making a desktop type app in the browser (great > > advantages) that uses server calls,and you want wxwidgets to appear > > from within the type of area shown above, is there a stable way of > > using top level functions like:
> > myWx = require("wx");
> > I've tried
> > myWx = glue.require("wx");
> > And
> > myWx.messageBox("hello from deep function"); works fine, but does not > > come to front of screen.
> > This works ... but
> > Is it correct/stable, in strict ECMA I expect it to be.
> > Also, can there be more than one wx object that calls ...
> > myWx.theApp.onInit = function(){}
> > ... Per / script?
> > Or are we limited to one object only per script being able to use > > dahDah.theApp.onInit = dahdaH
> > Specifically I have a switch statement which acts on the server > > request information, here is a segment. I have run the contents of the > > case statement below as a standalone GLUEscript and it works fine - > > changing/removing " response. " as appropriate.
> > case 'navigate': > > //response.contentType="text/plain"; > > //response.print("List Will be here"); > > // above response(s) test fine
> > var wxImagDir = glue.require("wx");
> > wxImagDir.initAllImageHandlers();
> > wxImagDir.theApp.onInit = function(){ // none of this seems to work
> > var simple = new wxImagDir.Frame(null, wxImagDir.Id.ANY, "Choose > > Directory");
> > var panel = new wxImagDir.Panel(simple, wxImagDir.Id.ANY);
> > var button = new wxImagDir.Button(panel, wxImagDir.Id.ANY, > > "Choose Image Directory", { x : 40, y : 50 }); > > var buttonClose = new wxImagDir.Button(panel, wxImagDir.Id.EXIT, "", > > { x : 290, y : 180 });
> > var showText = new wxImagDir.StaticText(panel, wxImagDir.Id.ANY, "", > > { x : 20, y : 20 }); > > showText.wrap = 200; > > showText.label = "Please Choose The Directory You Wish to Work > > with:";
> > response.contentType="text/plain"; > > response.print(glue.getDir.path); // as theApp.onInit does not appear > > to fire, this: TypeError: glue.getDir is undefined
> > wxImagDir.messageBox("hello from deep function"); // works fine if > > above line REMed out, but does not come to front of screen
> > break; > > Paul
> -- > You received this message because you are subscribed to the Google Groups > "GLUEscript" group. > To post to this group, send email to gluescript@googlegroups.com. > To unsubscribe from this group, send email to > gluescript+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/gluescript?hl=en.
For now I'll just use the new PHP 5.4.0beta1 for built in server requirements and GLUEscript by system() calls from there for ui requirements outside the browser.
Paul
On 17 October 2011 11:16, Paul A Norman <paul.a.nor...@gmail.com> wrote:
> Tangling threads ... ok avoid spider's web .. thanks for that.
> Will it be ok to do pipes for command line input in side server functions > the same way or does the same apply?
> Paul
> On 17 October 2011 02:10, Franky Braem <franky.br...@gmail.com> wrote:
>> I don't think it's a good idea to mix wx code and other multithreaded >> code (the server socket code is run in another thread then the main >> thread). There's only one theApp variable in a script. onInit is only >> called before the wx-application enters the mainloop. So changing this >> function has no effect.
>> > var factory = new net.HTTPRequestHandlerFactory(); >> > factory.createRequestHandler = function(request) >> > { >> > var handler = new >> > net.HTTPRequestHandler(); >> > handler.handleRequest = >> > function(request, response) >> > {
>> > // doing something at this level
>> > } >> > glue.server = new net.HTTPServer(factory, new >> > net.ServerSocket(glueServerSocket), new net.HTTPServerParams()); >> > glue.server.start();
>> > And you are making a desktop type app in the browser (great >> > advantages) that uses server calls,and you want wxwidgets to appear >> > from within the type of area shown above, is there a stable way of >> > using top level functions like:
>> > myWx = require("wx");
>> > I've tried
>> > myWx = glue.require("wx");
>> > And
>> > myWx.messageBox("hello from deep function"); works fine, but does not >> > come to front of screen.
>> > This works ... but
>> > Is it correct/stable, in strict ECMA I expect it to be.
>> > Also, can there be more than one wx object that calls ...
>> > myWx.theApp.onInit = function(){}
>> > ... Per / script?
>> > Or are we limited to one object only per script being able to use >> > dahDah.theApp.onInit = dahdaH
>> > Specifically I have a switch statement which acts on the server >> > request information, here is a segment. I have run the contents of the >> > case statement below as a standalone GLUEscript and it works fine - >> > changing/removing " response. " as appropriate.
>> > case 'navigate': >> > //response.contentType="text/plain"; >> > //response.print("List Will be here"); >> > // above response(s) test fine
>> > var wxImagDir = glue.require("wx");
>> > wxImagDir.initAllImageHandlers();
>> > wxImagDir.theApp.onInit = function(){ // none of this seems to work
>> > var simple = new wxImagDir.Frame(null, wxImagDir.Id.ANY, "Choose >> > Directory");
>> > var panel = new wxImagDir.Panel(simple, wxImagDir.Id.ANY);
>> > var button = new wxImagDir.Button(panel, wxImagDir.Id.ANY, >> > "Choose Image Directory", { x : 40, y : 50 }); >> > var buttonClose = new wxImagDir.Button(panel, wxImagDir.Id.EXIT, "", >> > { x : 290, y : 180 });
>> > var showText = new wxImagDir.StaticText(panel, wxImagDir.Id.ANY, "", >> > { x : 20, y : 20 }); >> > showText.wrap = 200; >> > showText.label = "Please Choose The Directory You Wish to Work >> > with:";
>> > response.contentType="text/plain"; >> > response.print(glue.getDir.path); // as theApp.onInit does not appear >> > to fire, this: TypeError: glue.getDir is undefined
>> > wxImagDir.messageBox("hello from deep function"); // works fine if >> > above line REMed out, but does not come to front of screen
>> > break; >> > Paul
>> -- >> You received this message because you are subscribed to the Google Groups >> "GLUEscript" group. >> To post to this group, send email to gluescript@googlegroups.com. >> To unsubscribe from this group, send email to >> gluescript+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/gluescript?hl=en.