linercenter.blogg.se

Mandrake linux
Mandrake linux










  1. #Mandrake linux how to
  2. #Mandrake linux install
  3. #Mandrake linux code
  4. #Mandrake linux windows

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.

mandrake linux mandrake linux

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.

  • Line 10: ask_warn is a simple message with an OK button.
  • Line 8: We’re creating a new user interface.
  • Line 6: Again, this is standard Perl strict just enforces strict variable, reference, and subroutine rules when your code is passed to the Perl interpreter.
  • Line 5: interactive pulls in the core of the drak toolkit.
  • Line 3: We tell Perl to add /usr/lib/libDrakx to the library path.
  • Line 1: This is a standard Perl script header.
  • But how does this work? Let’s walk through the code, line by line. As you can see in Figure A and Figure B, the user is presented with essentially the same interface, whether at the console or using the GUI. The application in Listing A displays a prompt and an OK button, which closes the program. The Mandrake installer uses this same toolset to offer both a GUI and text-based installer. If you’ve been involved with Linux for any length of time and remember the old Slackware dialog-based installer, you’ll find that the newt interface is similar. The X GUI functionality is provided by perl-GTK, while the console display is handled by libnewt. A number of common routines used by the Mandrake developers come from perl-MDK-Common.

    mandrake linux

    #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.

    mandrake linux

    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












    Mandrake linux