Plugin2.0 - URL fetching does not work on WindowsNT 
Author Message
 Plugin2.0 - URL fetching does not work on WindowsNT

Hi,

I have written a tclet that uses "home policy" to fetch another tcl
script from the home site of URL. This example work correctly on
solaris2.5.1 with Netscape 4.04. However, when I try the same example
from a WindowsNT machine with Netscape 4.04, a timeout occurs for
::browser::getURL command.

I have posted this example at:
http://www.*-*-*.com/ ~lavana/test/fetch.shtml

The plugin code is:
# fetch.tcl --
#

  # Get the URL for tclet's home site
  set originHomeDirURL [string trimright [getattr originHomeDirURL] /]
  # Use home policy
  policy home
  # Fetch URL from home site
  eval [::browser::getURL $originHomeDirURL/helloWorld.tcl]

#########

# helloWorld.tcl
#

  set hello .h
  button $hello -text "Hello World"
  pack $hello -expand 1 -fill both

######

Thanks,

--

Off: 2300 CBL, Research IV, Centennial Campus,  |Res: 1707-4, Crest Rd.,
     NCSU, Box 7550, Raleigh, NC 27695-7550.    |     Raleigh, NC 27606.
     Ph: (919) 515-9677, Fax: (919) 513-1895    |     Ph: (919) 821-0913



Sat, 02 Sep 2000 03:00:00 GMT  
 Plugin2.0 - URL fetching does not work on WindowsNT

Hemang,

As I understand it, the way the plugin works, one cannot use the getURL
command synchronously (sp). The tclet won't actually go get the URL
until it reaches the end of the script and goes into event processing.
If I understand John O. correctly, to do otherwise would cause problems
with the way the tclet interacts with the browser.

If I didn't explain myself well, I offer my apologies. I've never been a
gifted speaker ;-)

Robert Seeger

Quote:

> Hi,

> I have written a tclet that uses "home policy" to fetch another tcl
> script from the home site of URL. This example work correctly on
> solaris2.5.1 with Netscape 4.04. However, when I try the same example
> from a WindowsNT machine with Netscape 4.04, a timeout occurs for
> ::browser::getURL command.

> I have posted this example at:
> http://www.cbl.ncsu.edu/~lavana/test/fetch.shtml

> The plugin code is:
> # fetch.tcl --
> #

>   # Get the URL for tclet's home site
>   set originHomeDirURL [string trimright [getattr originHomeDirURL] /]

>   # Use home policy
>   policy home
>   # Fetch URL from home site
>   eval [::browser::getURL $originHomeDirURL/helloWorld.tcl]

> #########

> # helloWorld.tcl
> #

>   set hello .h
>   button $hello -text "Hello World"
>   pack $hello -expand 1 -fill both

> ######

> Thanks,

> --

> Off: 2300 CBL, Research IV, Centennial Campus,  |Res: 1707-4, Crest Rd.,
>      NCSU, Box 7550, Raleigh, NC 27695-7550.    |     Raleigh, NC 27606.
>      Ph: (919) 515-9677, Fax: (919) 513-1895    |     Ph: (919) 821-0913



Sat, 02 Sep 2000 03:00:00 GMT  
 Plugin2.0 - URL fetching does not work on WindowsNT

It seems that the "blocking" version of browser::getURL
is not working reliably with on Windows when used from
the main tcl code(*), a simple workaround is to use
after idle {eval browser::getURL helloWorld.tcl}
instead. By the way, getURL accepts relative URLs
to the origin URL so you don't need to redo that
manually.
I have added the working example at:

 http://sunscript.sun.com/plugin/v2/source.html

You could also use the non blocking form with call back:

proc sourceCB {reason data} {
  if {$reason != EOF} {
        error "geturl error $reason $data"
  }
  uplevel #0 $data

Quote:
}

browser::getURL $url {} {} {} sourceCB

(*): this is probably a "bug". but I don't have the ressources
     to investigate it, so meanwhile, you'll have to do with
     the workaround.

Thanks
Regards

Quote:

> I have written a tclet that uses "home policy" to fetch another tcl
> script from the home site of URL. This example work correctly on
> solaris2.5.1 with Netscape 4.04. However, when I try the same example
> from a WindowsNT machine with Netscape 4.04, a timeout occurs for
> ::browser::getURL command.

> I have posted this example at:
> http://www.cbl.ncsu.edu/~lavana/test/fetch.shtml

> The plugin code is:
> # fetch.tcl --
>   # Get the URL for tclet's home site
>   set originHomeDirURL [string trimright [getattr originHomeDirURL] /]
>   # Use home policy
>   policy home
>   # Fetch URL from home site
>   eval [::browser::getURL $originHomeDirURL/helloWorld.tcl]
> # helloWorld.tcl
>   set hello .h
>   button $hello -text "Hello World"
>   pack $hello -expand 1 -fill both

--



Sun, 03 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. My labVIEW application is not working on an WindowsNT system when I have no administrator rights

2. file()-function in WindowsNT not working ?

3. Fetch Not Working (C5EE & ABC)

4. url "javascript:..." does not work

5. passing data via URL not working

6. Unable to fetch local URL's

7. beyond fopen(), fetching url with headers?

8. fetching a url

9. Fetching a URL in 7.6?

10. Fetch URL w/ proxy Server

11. url fetching code on sun socket layer?

12. Xfreeze_1.4 doesn′t work on my WindowsNT 4.0

 

 
Powered by phpBB® Forum Software