Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
accessing top objects/functions within factory.createRequestHandler = function(request) and multiple object calls to .theApp.onInit
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
PaulANormanNZ  
View profile  
 More options Oct 14 2011, 8:47 pm
From: PaulANormanNZ <paul.a.nor...@gmail.com>
Date: Fri, 14 Oct 2011 17:47:27 -0700 (PDT)
Local: Fri, Oct 14 2011 8:47 pm
Subject: accessing top objects/functions within factory.createRequestHandler = function(request) and multiple object calls to .theApp.onInit
Hi,

When you're doing something like ...

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); //

                getDir.showModal();

                glue.getDir = getDir;

simple.close();
            }

buttonClose.onClicked =  function(){
simple.close();

}

        simple.center();
          simple.visible = true;
return true;
 }

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Franky Braem  
View profile  
 More options Oct 16 2011, 9:10 am
From: Franky Braem <franky.br...@gmail.com>
Date: Sun, 16 Oct 2011 06:10:11 -0700 (PDT)
Local: Sun, Oct 16 2011 9:10 am
Subject: Re: accessing top objects/functions within factory.createRequestHandler = function(request) and multiple object calls to .theApp.onInit
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul A Norman  
View profile  
 More options Oct 16 2011, 6:16 pm
From: Paul A Norman <paul.a.nor...@gmail.com>
Date: Mon, 17 Oct 2011 11:16:41 +1300
Local: Sun, Oct 16 2011 6:16 pm
Subject: Re: accessing top objects/functions within factory.createRequestHandler = function(request) and multiple object calls to .theApp.onInit

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul A Norman  
View profile  
 More options Oct 18 2011, 7:40 pm
From: Paul A Norman <paul.a.nor...@gmail.com>
Date: Wed, 19 Oct 2011 12:40:01 +1300
Local: Tues, Oct 18 2011 7:40 pm
Subject: Re: accessing top objects/functions within factory.createRequestHandler = function(request) and multiple object calls to .theApp.onInit

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »