#include Once "window9.bi"

Function Hyperlinkgadget( iGadget As Long , x As Long, y As Long, width_ As Long, height_ As Long  , sTextLink As String = "" ) As Hwnd Export
	
	Dim As HWND hyperlink , vBox , mainBox , eventbox 
	
	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)	
	
	eventbox = gtk_event_box_new ()
	
	hyperlink = gtk_label_new (sTextLink)
	
	gtk_label_set_markup (GTK_LABEL (hyperlink), "<u>" & sTextLink & "</u>")

	Dim As GdkColor color_ 
	
	color_.red = Cast(Short,((0 And &h000000FF)Shl 8))
	
	color_.blue = Cast(Short,((&hFF0000 And &h00FF0000) Shr 8))
	
	color_.green = Cast(Short,(0 And &h0000FF00))		
	
	gtk_widget_modify_fg (hyperlink, GTK_STATE_NORMAL, @color_)	
	
	gtk_container_add (GTK_CONTAINER (eventbox), hyperlink)
	
	pGlobalTypeWindow9->ListGadgets->addNodeSub(iGadget , Cint(hyperlink) ,  11)
	
	gtk_widget_set_size_request(eventbox, width_, height_)
	
	gtk_fixed_put(GTK_FIXED(vbox), eventbox, x , y)
	
	g_object_set_data (Cast(Any Ptr, hyperlink), "X_SIZE" , Cast(Any Ptr,Cint(x)))
	
	g_object_set_data (Cast(Any Ptr, hyperlink), "Y_SIZE" , Cast(Any Ptr,Cint(y)))
	
	g_object_set_data (Cast(Any Ptr, hyperlink), "W_SIZE" , Cast(Any Ptr,Cint(width_)))
	
	g_object_set_data (Cast(Any Ptr, hyperlink), "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(eventbox), "event", G_CALLBACK (@EventsHyperLinkGadgetAllFunc), @(fNode->x))
	
	g_signal_connect(G_OBJECT(eventbox), "size-allocate", G_CALLBACK (@size_allocate_signals), @(fNode->x))
	
	gtk_widget_show(vBox)

	gtk_widget_show(hyperlink)
	
	gtk_widget_show(eventbox)
	
	gtk_widget_modify_font(hyperlink , pGlobalTypeWindow9->fontCurent)
	
	Return hyperlink	
	
End Function