Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, We are planning to create a small tool with minimal GUI and have settled with Perl. We are planning to run the tool on Windows currently. But we would love to know if we could port the same code generated by WinLoft to a Linux box. Thnx, Manoj

Replies are listed 'Best First'.
Re: WinLoft - Can we port it to Linux?
by davido (Cardinal) on Jun 28, 2004 at 06:31 UTC

    Look at using the Tk series of modules for GUI stuff that is portable across various platforms. The Tk modules provide a complete toolkit of GUI gadgets. There are other choices out there, but this is one popular one, that I'm somewhat familiar with. It is fairly well supported in the Perl community.

    I have no idea what WinLoft is... googling for it just turned up a bunch of geneology sites. ;)


    Dave

      U can find WinLoft at http://www.bahnhof.se/~johanl/perl/Loft/
        As that site says, the applications built with WinLoft use the Win32::GUI interface, which is only available on Windows.

        You might be able to leverage some of its capabilities for a porting effort, but it's likely to be incomplete and labor-intensive; there is no easy way to port Win32::GUI code to platforms which don't support the Win32 API.

Re: WinLoft - Can we port it to Linux?
by BUU (Prior) on Jun 28, 2004 at 07:36 UTC
    That depends on which Windowing Toolkit "Winloft" uses to generate it's GUI. If it's something propietary, like Win32::GUI, it probably won't work. Otherwise if it uses say, Tk, or Wx, then porting it is as easy as installing whichever modules you need on the new system and copying your file.
Re: WinLoft - Can we port it to Linux?
by jplindstrom (Monsignor) on Jun 28, 2004 at 16:47 UTC
    It's "The GUI Loft", thanyouverymuch :)

    TGL does one thing: it lets you design Windows/Dialog boxes and then builds them for you at runtime.

    Currently, only Win32::GUI is supported. I don't see that changing in the near future.

    The problem with chosing one GUI toolkit is that you have to buy into the whole framework. Even if TGL could be made to create other types of windows, the event model and lots of other things would be very different.

    If Windows is you desktop OS, then Win32::GUI is a good choise. For me and many other people, the corporate environment makes Windows a constant, so cross-platform is a non-issue.

    So if you need a cross-platform GUI, then Win32::GUI is obviously not a very wise choise :) I would probably go with wxWindows/wxPerl because of the decent native look-and-feel on the most widely used desktop platform (yeah, that would be Windows).

    However, regardless of the GUI toolkit you chose, keeping the presentation logic separated from the application- and business logic as much as possible is a good design which will help the application grow gracefully. (Compare the approach with the use of templates when doing web development -- code in the template is okay as long as it's related to presentation logic.) If you do that, porting the application to another windowing toolkit wouldn't be that difficult, should the need arise.

    /J