Just starting out? Need help? Post your questions and find answers here.
marc_256
Addict
Posts: 855 Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:
Post
by marc_256 » Mon Sep 22, 2025 8:06 am
Hi,
I use Randy Walker example and it works very well,
at the same time, I know the length of the received messages ...
Randy Walker wrote: Sat Sep 20, 2025 3:53 am
Hi marc... I've always used sendmessage to do that. Unfortunately not cross platform, but works well enough for me in Windows:
Code: Select all
bottom = Len(GetGadgetText(YourGadget))
SendMessage_(GadgetID(YourGadget), #EM_SETSEL, bottom, bottom)
Thanks all for helping,
marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Randy Walker
Addict
Posts: 1078 Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA
Post
by Randy Walker » Mon Sep 22, 2025 7:23 pm
marc_256 wrote: Mon Sep 22, 2025 8:06 am
Hi,
I use Randy Walker example and it works very well,
at the same time, I know the length of the received messages ...
Randy Walker wrote: Sat Sep 20, 2025 3:53 am
Hi marc... I've always used sendmessage to do that. Unfortunately not cross platform, but works well enough for me in Windows:
Code: Select all
bottom = Len(GetGadgetText(YourGadget))
SendMessage_(GadgetID(YourGadget), #EM_SETSEL, bottom, bottom)
Thanks all for helping,
marc
Shouild also note that #EM_SETSEL is used to select text:
If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(0, 8, 8, 306, 133)
SetGadgetText(0,"Mary had a little lamb.")
SetActiveGadget(0)
bottom = Len(GetGadgetText(0))
SendMessage_(GadgetID(0), #EM_SETSEL, bottom-5, bottom-1)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
- - - - - - - - - - - - - - - -
Randy
I *never * claimed to be a programmer.
Piero
Addict
Posts: 993 Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy
Post
by Piero » Mon Sep 22, 2025 10:58 pm
Mindphazer wrote: Sun Sep 21, 2025 5:38 pm
Piero wrote: Sun Sep 21, 2025 4:23 pm
Mindphazer wrote: Sun Sep 21, 2025 2:37 pm on MacOS
Code: Select all
Range.NSRange\location = Len(GetGadgetText(0))
CocoaMessage(0, GadgetID(0), "scrollRangeToVisible:@", @Range)
I know
Rashad was trying to write a code without API calls
Please forgive me: I just wanted to help; the last post when I answered was just windoze gibberish (no multiplatform goodie)