Sign in to follow this  
Followers 0
fi3ldy

RealTime Textarea (GUiCtrlCreateEdit) text update/insert

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#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


[center]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.[/center]

Share this post


Link to post
Share on other sites

lol, fastest reply ever. big thanks <3

Share this post


Link to post
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
Sign in to follow this  
Followers 0