GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PRIMA::NOX11 (3)

.ds Aq ’

NAME

Prima::noX11 - Use Prima without X11

CONTENTS

SYNOPSIS



   use Prima::noX11;
   use Prima;

   my $error = Prima::XOpenDisplay();
   if ( defined $error) {
        print "not connected to display: $error\n";
   } else {
        print "connected to display\n";
   }



DESCRIPTION

Prima will by default connect to X11 server on unix. To use Prima functionality in modules or programs where this default behavior is undesired, please follow the guidelines below.

    No connection

In the beginning of a script or a module that is never intended to connect to X11 display, add this:



  use Prima::noX11;
  use Prima;



It will be possible to connect to X11 server later on manually.

    Manual connect to X11

If connection to X11 is optional, use this code after use Prima::noX11 was invoked:



   my $error = Prima::XOpenDisplay();
   if ( defined $error) {
        print "not connected to display: $error\n";
   } else {
        print "connected to display\n";
   }



    Checking if GUI functionality is accesiible.

Without X11 connection, no GUI functionality such as screen grabbing will be accessible. In addition to that functionality, windowing functions will only become accessible after Prima::Application creates a single instance $::application.

Therefore, if $::application is defined, then all GUI functions can be safely used. If, on the contrary, it is not defined, initiate it as this:



        unless ( $::application) {
                my $error = Prima::XOpenDisplay();
                die $error if defined $error;
                require Prima::Application;
                import Prima::Application;
        }



AUTHOR

Dmitry Karasik, <dmitry@karasik.eu.org>.

SEE ALSO

Prima::X11
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PRIMA::NOX11 (3) 2014-09-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.