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

Hello Monks,

I am developing my first GUI for a simple application I wrote. I would like to know if it is possible for Win32::GUI to support the ability to modify the appearance of the GUI Window or DialogBox based on user selection of options in the program.

For example, the application has a main menu style and submenu's depending on the main menu option that is selected. If there is an Add and Delete option from the main menu I would like to modify the appearance of the Window based on whether the user selected Add or Delete.

I want to keep the actual Add and Delete buttons throughout the whole run of the program, but is it possible to add new buttons and controls to the window if the user selected Add, and then remove them from the window if the user then selects Delete (which will add its own set of new buttons and controls to the Delete submenu, that then disappear if Add is chosen again).

If Win32::GUI doesnt work then what would do the trick in creating a more dynamic, modifyable GUI at runtime. I chose Win32::GUI over Tk because PerlApp seems to work best with it and creates smaller files. Advice and knowledge is appreciated. Thank you.

Jason

Replies are listed 'Best First'.
Re: General Win32::GUI question
by BrowserUk (Patriarch) on Aug 02, 2004 at 18:45 UTC

    It is certainly possible to create controls at runtime using the Win32::APIs that underly Win32::GUI. Whether that functionality has been exposed or not I can;t say because I haven't done (much of) anything with it.

    However, a more common and easy tactic to use is to create all the buttons you need wherever you need them in the application andrather than Add and Delete them on-the-fly, hide and unhide them as required.This makes maintaining the correct window hierarchy and message flows much simpler.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      Thank you very much for your help, this is exactly what I wanted to be able to do.

      Do you know offhand how to edit a DialogBox's help (?) button? I know how to add/remove the button, but not edit its functionality. I am guessing there is a helpbutton_click event, or something like that, but I can't find any official documentation detailing it.

      Thanks again,

      Jason