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

Fellow Monks,

In my quest for the perfect Win32 app - there are some very minor and probably very simple cosmetic/operation issues I was hoping to get assistance wtih as im not able to find specific information - and probably someone else has been there done that..

1) It is possible to force a carriage return within the text as part of the AddLabel function. I already know about the wrap options, but I want control of where it inserts a return.

2) How does one print extended HTML characters in text fields for lablels, titles, etc? Specifically i need to display a copyright character, and im not sure of the sequence to use to display this or other extended characters..

3) I packaged my app using PAR - which works as a great alternative to create exe files, however it takes a very long time to load the actual exe program in windows - even for a short 5-10 line "Hello Me" type script. I guess this is just the way it is but:

- Does anyone have any recommendations for displaying a "pop-up" logo/screen/icon while the main program is loading? I thought I would make a very short and sweet program that serves just this purpose - then creates a process for the main program - and exits after 5-10 seconds or so, BUT the pop-up program takes forever to load itself!

- What are the flags for displaying a window without a top bar/close button (for the aforementioned pop-up image).

- I understand that to display a bitmap on a button, I create an object to the bitmap itself, then specify the object as the value for '-bitmap' on the button. THis works. I want to do the same for an AddLabel function, but it does not work when doing the identical syntax. What is the proper syntax for displaying a bitmap on a label?

- I assume this is the best way to do a 'pop-up' image while a program is loading. Is there another more straight forward way im not thinking of?

Thanks in advance for any response.. im a real newbie at this..

Steve

Replies are listed 'Best First'.
Re: WIn32::gui Miscellaneous
by jplindstrom (Monsignor) on Mar 30, 2005 at 13:11 UTC
    1) Have you tried \n or \r? May work. Please let us know.

    2) Try the Latin-1 version of the char. I'm not sure Win32::GUI supports UTF16 which I think is the normal encoding in many Windows API calls. But those may not be used by Win32::GUI.

    4) If you download The GUI Loft and install the PPMs, there is a Win32::GUI::BorderlessWindow available, which sounds like what you want.

    5) The -bitmap option should work, if it doesn't try something like:

    my $bmpSaveAs = Win32::GUI::Bitmap->new($file) or die; $lblSaveAs->SetImage($bmSaveAs);

    /J

Re: WIn32::gui Miscellaneous
by Anonymous Monk on Mar 30, 2005 at 11:00 UTC
    Hello,

    I would recommend you to forget about PAR and this "showing logo" idea. I'd recommend you to make (using free NSIS installer) an installer for your app (that will install all perl interpreter and only required Perl modules). This way your app will start instantly, you will also have a chance to create menu items and get uninstall entry in Control Panel, and your prog will take about 5Mb installed on disk while installer being sized 1.3Mb.

    For example I've seen such approach with Stunnix JavaScript Obfuscator - just click on Evaluate link, enter your email and inspect what their installer produced on your disk. (BTW it uses locally-running webserver (written in Perl) and Perl-driven site running on it for GUI, so it can work on any OS Perl runs on).

    Good luck!

Re: WIn32::gui Miscellaneous
by Plotinus (Sexton) on Mar 30, 2005 at 13:36 UTC
    Can't offer too much help as I'm a bit of a newbie myself but I used perl5.dll to minimize the size of my executable and a side-effect of that is that my exe's seemed to fire up quicker. However this requires that perl5.dll is distributed to all the machines that will run the exe which is ok in my environment but might not be suitable for yours.

    Plotinus

      Hi.

      Im wondering if you can give me your syntax you are using on the command line to do this

      I tried a simple hello script:

      pp -d -o test.exe test.pl

      And I get the errors:

      Goto undefined subroutine &DynaLoader::bootstrap_inherit at C:/aperl58/lib/XSLoa der.pm line 95.

      Compilation failed in require at C:/aperl58/lib/IO/Handle.pm line 260.

      BEGIN failed--compilation aborted at C:/aperl58/lib/IO/Handle.pm line 260.

      Compilation failed in require at C:/aperl58/lib/IO/Seekable.pm line 101. BEGIN failed--compilation aborted at

      C:/aperl58/lib/IO/Seekable.pm line 101. Compilation failed in require at C:/aperl58/lib/IO/File.pm line 117.

      BEGIN failed--compilation aborted at C:/aperl58/lib/IO/File.pm line 117.

      Compilation failed in require at -e line 305.

      BEGIN failed--compilation aborted at -e line 835.

      Im using perl from Activestate for Win32:

      v5.8.6 built for MSWin32-x86-multi-thread

      Can I run this command with this version of perl or is there something special I should be doing?

      Eager to try this out.

      Steve