Jump to content

RealTime Textarea (GUiCtrlCreateEdit) text update/insert


fi3ldy
 Share

Recommended Posts

Im having trouble updating the text using guictrlsetdata.

this is the code:

CODE

#include <GUIConstants.au3>

GUICreate("Test", 600, 410,(@DesktopWidth-400)/2, (@DesktopHeight-400)/2)

$log_content = "information..."

$log_show = GUICtrlCreateEdit($log_content, 50, 50, 500, 310, $ES_READONLY, $ES_MULTILINE)

GUISetState()

HotKeySet("{F9}", "Update_Log")

Func Update_Log()

GLOBAL $log_updated = $log_content & @CRLF & "Next line with info..."

GUICtrlSetData($log_show, $log_updated)

EndFunc

While 1

sleep(10)

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then Exit

WEnd

Im using a hotkey atm, but i basically need it so when F9 is pressed, each time it inserts a new line... at the moment it only inserts one new line, then doesnt update it again, any help appriciated!

thanks alot

Link to comment
Share on other sites

  • Moderators

#include <GUIConstants.au3>

GUICreate("Test", 600, 410,(@DesktopWidth-400)/2, (@DesktopHeight-400)/2)

$log_content = "information..."
$log_show = GUICtrlCreateEdit($log_content, 50, 50, 500, 310, $ES_READONLY, $ES_MULTILINE)

GUISetState()

HotKeySet("{F9}", "Update_Log")
Func Update_Log()
$log_updated = GUICtrlRead($log_show) & @CRLF & "Next line with info..."
GUICtrlSetData($log_show, $log_updated)
EndFunc

While 1
sleep(10)
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...