General Terminal

GtOpenUrl

Open a URL through the operating system

Syntax

Signature
xBool GtOpenUrl( const char *url );

Arguments

url is the address to open, including its scheme.

Return value

T if the driver reports that the request was accepted, otherwise F.

Description

Pass the desired URL as the first program argument. The system’s configured handler decides how to open it.

Example

gtopenurl.c
#include "xdev-wtui.h"

#include <stdio.h>

int main( int argc, char **argv )
{
   if( argc != 2 )
   {
      fprintf( stderr, "Usage: %s url\n", argv[ 0 ] );
      return 1;
   }

   if( !GtOpenUrl( argv[ 1 ] ) )
   {
      fputs( "Unable to open the URL.\n", stderr );
      return 1;
   }

   return 0;
}

See also