- // Note that we are creating a new socket here, so this
- // won't mess with the client/server demo.
-
- // Ask for the URL
- m_text->AppendText(_("\n=== URL test begins ===\n"));
- wxString urlname = wxGetTextFromUser(_("Enter an URL to get"),
- _("URL:"),
- _("http://localhost"));
-
- // Parse the URL
- wxURL url(urlname);
-
- // Try to get the input stream (connects to the given URL)
- m_text->AppendText(_("Trying to establish connection...\n"));
- wxYield();
- wxInputStream *data = url.GetInputStream();
- if (!data)
- {
- m_text->AppendText(_("Error: couldn't read from URL\n"));
- m_text->AppendText(_("=== URL test ends ===\n"));
- return;
- }
+ // Ask for the URL
+ static wxString s_urlname("http://www.google.com/");
+ wxString urlname = wxGetTextFromUser
+ (
+ _("Enter an URL to get"),
+ _("URL:"),
+ s_urlname
+ );
+ if ( urlname.empty() )
+ return; // cancelled by user