Sfoglia il codice sorgente

[GTK3] Add font-setting support to SetFont() (#72)

Co-authored-by: Ronny Otto <>
Ronny Otto 1 anno fa
parent
commit
573af3d4f1
2 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 1 0
      gtk3maxgui.mod/gtkcommon.bmx
  2. 4 0
      gtk3maxgui.mod/gtkgadget.bmx

+ 1 - 0
gtk3maxgui.mod/gtkcommon.bmx

@@ -85,6 +85,7 @@ Extern
 	Function gtk_widget_destroy(handle:Byte Ptr)
 	Function gtk_widget_destroy(handle:Byte Ptr)
 	Function gtk_widget_show(handle:Byte Ptr)
 	Function gtk_widget_show(handle:Byte Ptr)
 	Function gtk_widget_hide(handle:Byte Ptr)
 	Function gtk_widget_hide(handle:Byte Ptr)
+	Function gtk_widget_override_font(handle:Byte Ptr, font_desc:Byte Ptr)
 ?bmxng
 ?bmxng
 	Function gtk_widget_get_preferred_size(handle:Byte Ptr, minSize:GtkRequisition Var, natSize:GtkRequisition Var)
 	Function gtk_widget_get_preferred_size(handle:Byte Ptr, minSize:GtkRequisition Var, natSize:GtkRequisition Var)
 	Function gtk_widget_get_allocation(handle:Byte Ptr, allocation:GtkAllocation Var)
 	Function gtk_widget_get_allocation(handle:Byte Ptr, allocation:GtkAllocation Var)

+ 4 - 0
gtk3maxgui.mod/gtkgadget.bmx

@@ -5028,6 +5028,10 @@ Type TGTKDefaultTextArea Extends TGTKTextArea
 	End Rem
 	End Rem
 	Method SetFont:Int(font:TGuiFont)
 	Method SetFont:Int(font:TGuiFont)
 		Super.SetFont(font)
 		Super.SetFont(font)
+		
+		If TGTKGuiFont(font)
+			gtk_widget_override_font(handle, TGTKGuiFont(font).fontDesc)
+		EndIf
 
 
 		' we need to reset the tabs, as it is lost when font is changed.
 		' we need to reset the tabs, as it is lost when font is changed.
 		SetTabs(_tabsize)
 		SetTabs(_tabsize)