Jump to content

Log in GUICtrlCreateEdit


Recommended Posts

Hello!

How to create something like GUI script log.

I made GUICtrlCreateEdit (read only) and I wanna add there new msg depending on that was is going on with the script.

My problem is that if I use GUICtrlSetData it cleans msg that was there b4 so I can just see last change in log. How to deal with it ?

Link to comment
Share on other sites

  • Moderators

@lokatylokacz there are several ways to do it (as with most things in AutoIt). In essence, you need to read in what text is in the edit control and add that to your GUICtrlSetData. Something like this perhaps:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Local $hGUI = GUICreate("Test", 300, 300)
Local $hEdit = GUICtrlCreateEdit("", 10, 10, 280, 200)
Local $btnGo = GUICtrlCreateButton("Go", 250, 250, 40, 40)

GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $btnGo
                GUICtrlSetData($hEdit, @TAB & "========Initializing Program========" & @CRLF)
                    For $a = 1 To 10
                        GUICtrlSetData($hEdit, GUICtrlRead($hEdit) & "===Executing Line " & $a & " of Program===" & @CRLF)
                    Next
                GUICtrlSetData($hEdit, GUICtrlRead($hEdit) & @TAB & "========Program Complete========")
        EndSwitch
    WEnd

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

@FrancescoDiMuro you are 100% correct, I made something of a Rube Goldberg machine there :>

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...