Code: Select all
If OpenWindow(0,200,200,300,100,"Ampersand Problem",#PB_Window_SystemMenu)
Q$="&Ooops..."
TextGadget(9,50,30,200,20,Q$)
Repeat
ev=WaitWindowEvent()
Until ev=#PB_Event_CloseWindow
EndIf
Code: Select all
If OpenWindow(0,200,200,300,100,"Ampersand Problem",#PB_Window_SystemMenu)
Q$="&Ooops..."
TextGadget(9,50,30,200,20,Q$)
Repeat
ev=WaitWindowEvent()
Until ev=#PB_Event_CloseWindow
EndIf
Code: Select all
If OpenWindow(0,200,200,300,100,"Ampersand Problem",#PB_Window_SystemMenu)
Q$="&Ooops..."
TextGadget(9,50,30,200,20,"")
SetWindowLongPtr_(GadgetID(9), #GWL_STYLE, GetWindowLongPtr_(GadgetID(9), #GWL_STYLE) ! #SS_NOPREFIX)
SetGadgetText(9, Q$)
Repeat
ev=WaitWindowEvent()
Until ev=#PB_Event_CloseWindow
EndIf
How complicateShardik wrote:It's possible to clear the #SS_NOPREFIX flag, but you have to do it before writing the text into the TextGadget in order to see the changed behaviour...
Code: Select all
Procedure TextGadget_(gadget,x,w,width,height,text.s,flags=0)
TextGadget(gadget,x,w,width,height,"",flags)
x=GadgetID(gadget)
If flags&#SS_NOPREFIX=#Null
SetWindowLongPtr_(x,#GWL_STYLE,GetWindowLongPtr_(x,#GWL_STYLE)!#SS_NOPREFIX)
EndIf
SetGadgetText(gadget,text)
EndProcedure
CompilerIf #PB_Compiler_Version>511
Macro TextGadget(a,b,c,d,e,f,g=0)
TextGadget_(a,b,c,d,e,f,g)
EndMacro
CompilerEndIf
If OpenWindow(0,200,200,300,100,"Ampersand Problem",#PB_Window_SystemMenu)
TextGadget(9,50,30,200,20,"&Ooops...")
Repeat
ev=WaitWindowEvent()
Until ev=#PB_Event_CloseWindow
EndIf
Darn smart macro you wrote here !Michael Vogel wrote:Code: Select all
... CompilerIf #PB_Compiler_Version>511 Macro TextGadget(a,b,c,d,e,f,g=0) TextGadget_(a,b,c,d,e,f,g) EndMacro CompilerEndIf