Page 1 of 1
[Done] Stringgadget bug
Posted: Wed Sep 03, 2025 9:28 am
by drgolf
Hello again,
With PB 6.30 B1, this code no longer work :
Code: Select all
If OpenWindow(0, 0, 0, 322, 205, "StringGadget BUG !", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(0, 10, 10, 200, 150, "aaaaaaa ",#ES_MULTILINE|#WS_BORDER|#WS_VSCROLL|#ES_AUTOVSCROLL|#PB_String_ReadOnly|#ES_WANTRETURN|#ESB_DISABLE_BOTH)
SetGadgetText(0,"absvdhfdhfh")
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Re: Stringgadget bug
Posted: Wed Sep 03, 2025 10:09 am
by STARGĂ…TE
What are all these Constants?
Only PB constants are officially supported!
https://www.purebasic.com/documentation ... adget.html
For multi line output, you can try to use the EditorGadget()
Re: Stringgadget bug
Posted: Wed Sep 03, 2025 11:06 am
by Fred
The right way to do that is to use SetWindowLongPtr_() with the style flag
Re: Stringgadget bug
Posted: Wed Sep 03, 2025 2:37 pm
by drgolf
Hello Fred,
The #es_multiline style dont work with Setwindowlongptr_().
See windows api doc here :
https://learn.microsoft.com/fr-fr/windo ... rol-styles
The stringgadget multiline is usefull because of contextmenu with clipboard functions.
I need to create the control and this is not easy (for me, simple and old coder).
Code: Select all
hInstance = GetModuleHandle_(0)
HwndEditText = CreateWindowEx_(#WS_EX_STATICEDGE,"EDIT","",#WS_VISIBLE | #WS_CHILDWINDOW |#ES_MULTILINE|#WS_BORDER|#WS_VSCROLL|#ES_AUTOVSCROLL|#PB_String_ReadOnly|#ES_WANTRETURN|#ESB_DISABLE_BOTH, 10,10,280,120,WindowID(0),200,hInstance,0)
SendMessage_(HwndEditText,#EM_REPLACESEL,0,"Hello"+#CRLF$+"aaaaaa")
Again, PB update break working apps...
Re: Stringgadget bug
Posted: Wed Sep 03, 2025 3:12 pm
by Fred
May be if you used the commands as documented, it wouldn't break ? Just an idea.
Re: Stringgadget bug
Posted: Wed Sep 03, 2025 3:16 pm
by Kiffi
Fred wrote: Wed Sep 03, 2025 3:12 pm
May be if you used the commands as documented, it wouldn't break ? Just an idea.

Re: Stringgadget bug
Posted: Fri Sep 05, 2025 9:36 am
by Fred
I will revert the change as it can't be modified after creation with SetWindowLongPtr()
Re: [Done] Stringgadget bug
Posted: Sat Sep 06, 2025 1:13 pm
by Fred
Fixed.