Thanks, that works beautifully.
Oddly enough, though, while the Return wasn't being entered as a \r\n
in my textfield, it wasn't being passed on to the button that has -ok
=> 1 set either, and the textfield was accepting the tab key to insert
a tab (until I found another workaround to let me tab out of a
I'd have to say that the behavior under Win2K and XP are *both*
incorrect. I'm not sure if this is an inconsistently-implemented
"feature" of Windows or a bug in Win32::GUI.
On 6/29/06, Robert May <rmay@...> wrote:
> Geoffrey Spear wrote:
> > Hi.
> > I've got a window with -dialogui => 1 set, containing a textfield with
> > -multiline => 1 set.
> > Under Windows 2000, which I was using until last week, it worked fine;
> > hitting Enter in the textfield moved to the next line.
> > This week, the machines in my office got upgraded to XP, and now
> > hitting Enter in the textfield does absolutely nothing.
> Is that the only change that was made. I would be surprised if that was
> what caused your problem. (but I am regularly surprised)
> > I can get to
> > a new line by hitting CTRL-Enter
> That's the design when -dialogui is used for a multi-line textfield (or
> RichEdit) control under windows. When this is the case Windows 'steals'
> <ENTER> to activate the default button on the dialog, and to get an
> '\r\n' sequence in the textfield you must <CTRL-ENTER>.
> > Is there any way to get a fully-functional multiline textfield without
> > having to give up the benefits of a dialogui?
> There is a was to change this behaviour: add
> -addstyle => ES_WANTRETURN,
> to your Textfield constructor (ES_WANTRETURN takes the value 4096).
> This allows the Textfield to 'steal' the <ENTER> back, but <ENTER> will
> no longer activate the default button while the textfield has focus.
> [In the next version of Win32::GUI there will be a '-wantreturn' option
> for Textfields/RichEdit controls, as I've lost track of the number of
> times I've seen this question on this list - I guess I should also make
> it a FAQ]
> Robert May
> Win32::GUI, a perl extension for native Win32 applications