Atif Iqbal <[EMAIL PROTECTED]> wrote:

> I am new to Haskell and wxhaskell.
> I want to get a string from one text box,process it  on button click
> and show the result  in another test box on the same window.

In that case, you only need to modify your code a little, to move the
point at which you read the text until after the button press.

>  stxt    <- textEntry p [enabled := True]
>  textlog <- textCtrl p [enabled := False, wrap := WrapNone] 
>     -- use text control as logger
>  textCtrlMakeLogActiveTarget textlog
>  mytext <- textCtrlGetValue stxt
>  eval   <- button p [text := "Process", on command := logMessage mytext]

change last two lines to:
   eval   <- button p [ text := "Process"
                      , on command := do mytext <- textCtrlGetValue stxt
                                         logMessage mytext ]

Regards,
    Malcolm

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
wxhaskell-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to