
To use it, you’ll want to include common.pm by adding use common to your code. If you want to display more text than a simple phrase, say, the contents of a file, you can use the Mandrake toolkit’s simple function cat_.
#Mandrake linux code
The code in Listing B illustrates how either interactive_gtk or interactive_newt will be used, based on the $DISPLAY variable and a test for the X environment. You’ll see other code in interactive.pm that checks to see whether the app requires root user privileges and if so, asks for the root password.
#Mandrake linux how to
The decision on how to proceed takes place in /usr/lib/libDrakx/interactive.pm, as shown in Listing B. If you unset the DISPLAY variable ( unset DISPLAY), you would see the text-based version. If you were to execute the above code while in X, with DISPLAY=:0, you would see the GUI version.


The $DISPLAY variable in the user’s environment determines the graphics mode. The “_(“ format is not required, but MandrakeSoft uses it to facilitate integrating language translation files so the text is displayed in the user’s native language based on the system locale configuration. The first argument is the window title, and the second is the displayed message.

#Mandrake linux install
I will walk you through how you can use libDrakx to create your own user interfaces.Ī standard Mandrake install includes drakxtools-newt, which offers a good portion of the underlying code needed to create the dual interface.

It includes both the core set of Mandrake’s configuration tools and the includes you need to build a new tool. Part of the drakxtools-newt package, libDrakx offers some custom commands and behaves correctly in console or X. One of the most useful drak tools is libDrakx, which is the Mandrake add-on to perl-GTK.
#Mandrake linux windows
Mandrake Linux has a reputation for providing a number of easy-to-use configuration tools that make crossing over to Linux from Windows or MacOS relatively easy.Īn interesting feature of the Mandrake configuration tools (also known as drak tools) is that many of them can be used in either console mode or in X (the Linux GUI). Most vendors offer configuration tools that guide users through the process of editing config files so they don’t have to do it by hand. We'll work through creating a simple window, as well as a more complex list interface.Īs Linux has become more popular, distributors have tried to put a more friendly face on the underlying complexity of the operating system. Mandrake's libDrakx allows you to create GUI or text interfaces with relative ease, especially if you have some Perl under your belt. Mandrake Linux’s libDrakx makes it easy to build user interfaces
