#include Once "window9.bi"

Function Stringgadget(iGadget As Long , x As Long , y As Long , width_ As Long , height_ As Long , sText As String = "" , style As Long = 0 , style2 As Long = 0) As HWND Export
	
	Dim As HWND entry , vBox , mainBox 
	
	Dim As ListT Ptr pListTemp

	Freegadget(iGadget)
	
	pGlobalTypeWindow9->OptGroup = 0 ' reset Group OptionGadget
	
	pListTemp = Cast(ListT Ptr,pGlobalTypeWindow9->ListWinAndContainers->findNodeFunc(Cint(pGlobalTypeWindow9->CurentHwnd)))
	
	mainBox = Cast(hwnd , pListTemp->anyTwoData)	

	vbox = gtk_fixed_new()

	gtk_container_add (GTK_CONTAINER(mainBox), vbox)	
	
	entry = gtk_entry_new ()
	
	If Len(sText) Then
	
		gtk_entry_set_text (Cast(Any Ptr,entry) , sText)

	Endif
	
	If style And ES_PASSWORD Then
	
		gtk_entry_set_visibility (Cast(Any Ptr,entry) , False)

	Endif
	
	If style And ES_READONLY Then
	
		gtk_editable_set_editable(Cast(Any Ptr,entry) , False)

	Endif	
	
	If 	style And ES_RIGHT Then
	
		gtk_entry_set_alignment(Cast(Any Ptr,entry) , 1)
	
	Elseif 	style And ES_CENTER Then
	
		gtk_entry_set_alignment(Cast(Any Ptr,entry) , 0.5)

	Endif			
	
	pGlobalTypeWindow9->ListGadgets->addNodeSub(iGadget , Cint(entry) ,  6)

	gtk_widget_set_size_request(entry, width_, height_)
	
	gtk_fixed_put(GTK_FIXED(vbox), entry, x , y)
	
	g_object_set_data (Cast(Any Ptr, entry), "X_SIZE" , Cast(Any Ptr,Cint(x)))
	
	g_object_set_data (Cast(Any Ptr, entry), "Y_SIZE" , Cast(Any Ptr,Cint(y)))
	
	g_object_set_data (Cast(Any Ptr, entry), "W_SIZE" , Cast(Any Ptr,Cint(width_)))
	
	g_object_set_data (Cast(Any Ptr, entry), "H_SIZE" , Cast(Any Ptr,Cint(height_)))	
	
	tree_add_node(iGadget,pGlobalTypeWindow9->treeNumberGadgets)
	
	Dim As Node Ptr fNode = tree_find_node(iGadget,pGlobalTypeWindow9->treeNumberGadgets)	
	
	g_signal_connect(G_OBJECT(entry), "event", G_CALLBACK (@EventsStringGadgetAllFunc), @(fNode->x))
	
	g_signal_connect(G_OBJECT(entry), "size-allocate", G_CALLBACK (@size_allocate_signals), @(fNode->x))
	
	gtk_widget_show(vbox)
	
	gtk_widget_show(entry)

	gtk_widget_modify_font(entry , pGlobalTypeWindow9->fontCurent)
	
	Return entry
		
End Function