2 problems with that function, it reads width and height wrong( i fixed that by replace the WB3D_gadgetW/H commands with the raw data, second thing wrong is i create a window (runtime thingy) then it jumps over from the center window function, making a ugly flicker,
my mistake, i quickly wrote the function without testing.
also if i use WS_CHILD as a style for the text area, then whats the point? i cant pick a style..
WS_CHILD is required when creating child gadgets, consider the main blitz3d window as the parent and we want child gadgets within the window. styles can be combined using 'Or' to make use for all winapi constant's.
also do you know by chance how to retrieve what the user types into a text area?
use WB3D_TextAreaText() to grab the full content of the textarea.
you might want to use WB3D_CreateEditField() for single line edit gadgets. WB3D_TextAreaText() uses multi line features for say a text editor. to get the text typed into WB3D_CreateEditField() gadgets use WB3D_GetGadgetText()
here's an example
; were using external winapi styles
Include "WB3DStyles.bb"
width = 800
height = 600
; setup gfx mode.
Graphics width,height,16,2
; install winblitz3d.
Global RuntimeWindow_hWnd = WB3D_InitializeGUI(SystemProperty("AppHwnd"),WB3D_GadgetWidth(WB3D_DeskTop())/2-width/2,WB3D_GadgetHeight(WB3D_DeskTop())/2-height/2,width,height)
tex=WB3D_CreateEditField("",100,100,150,20,RuntimeWindow_hWnd,WS_CHILD Or ES_PASSWORD,0)
; cleanup any old creation events, its better to do this before we enter the main
; event loop, when some gadgets are created they generate events.
WB3D_FlushEvents
; setup out quit flag, and loop until the flag is set.
QUIT = 0
While Not QUIT = 1
Cls
Flip
; get an event of the event queue.
event = WB3D_WaitEvent()
Select event
Case WB3D_EVENT_KEYPRESS
; wb_eventdata holds the key code that was pressed.
keypressed = WB3D_EventData()
Select keypressed
Case WB3D_KEY_ENTER
WB3D_Notify "Gadget contents!",WB3D_GetGadgetText(tex),0
Case WB3D_KEY_ESCAPE
; set the flag to leave the loop.
QUIT = 1
End Select
Case WB3D_EVENT_WINDOW_CLOSE
; wb3d_eventsource hold the handle to the window that close button was selected
window = WB3D_EventSource()
Select window
Case RuntimeWindow_hWnd
; set the flag to leave the loop.
QUIT = 1
End Select
End Select
Wend
; use notify using external winapi constants.
;WB3D_Notify "WB3D GUI Window Example","Bye, Thats It I Quit",MB_OK Or MB_ICONASTERISK
WB3D_EndGUI()
EndGraphics
End
kev