> I am "porting" an app I did in Tk, over to Win32::GUI, it's basically a
> ground up re-write, and I've been looking for an excuse to learn Win32::GUI,
> but I've run into a few problems.
>
> #1 How can I bind a keystroke to a Widget in Win32::GUI? Such as a tab or
> enter key to a textfield? In Tk, this is easy, as you use Bind(). Or
> another way to ask it is this... In the Tk version, I have bound the enter
> key to a password entry widget, this way if the user hits enter while that
> widget has focus, it calls the same subroutine as clicking the "logon"
> button, that way the user didn't have to "tab" to it, or use the mouse to
> click, though both of those methods worked as well. Is there a way to make
> a button the global default when the enter key is pressed? as that would
> generate the same result
There is no keybinding as you describe (Win32::GUI is still a beta project
and not fully functional), but you may look at the -ok and -default
options to get what you want.
> #2 Is there a replacement for Tk's Frame widgets? like creating a window
> within a window? and how do you get the sunken, or ridged borders drawn
> around them? I've looked at a few of the sample scripts, and I know the
> answer is in the -style tag, but I have no idea what all those constants
> mean, and some, where the names SOUND explanatory enough, are useless
> because I have no grasp of the context.
There is a Windows Groupbox:
$Win->AddButton(
-text => "Groupbox",
-name => "GroupBox_1",
-left => 44,
-top => 35,
-width => 208,
-height => 63,
-style => WS_CHILD | WS_VISIBLE | 7, # GroupBox
);
> #3 How do I create a simple yes/no dialog box with an info icon, or a
> warning icon? That was very easy in Tk. I know Win32::GUI has a DialogBox
> creation method, what flags need to go to the style tag to get a dialog like
> that?
I don't know if there is a style for that (maybe), but you can always
create your own yes/no dialog box and add a bitmap.
> I apologize if these are easily explained in the docs somewhere, I have been
> through what was available on Aldo's site, but I just don't know enough
> about the Win32 API to understand what most of it means. Thanks!
You may want to take a look at my GUI Builder which let you design some of
this visually. It is still very much in the early stages but it still
can save alot of time building the initial layout.
-David Hiltz