我开始将 Genie 与 Pango + Gtk 一起使用。
我想用 Pango 更改标签的文本样式,但 modify_font 和 override_font 都已弃用。
使用 Pango 的此代码的替代方案是什么?
uses Gtk
uses Pango
init
Gtk.init (ref args)
var TestGtk = new Ventana()
TestGtk.show_all()
Gtk.main()
class Ventana : Window
init
title = "Test Genie + Pango"
default_width = 500
default_height = 200
window_position = WindowPosition.CENTER
destroy.connect(Gtk.main_quit)
var etiqueta = new Label("Hola Genie + Pango")
var fontdesc = new Pango.FontDescription()
fontdesc.set_family("Purisa")
fontdesc.set_size((int)(24 * Pango.SCALE))
//etiqueta.modify_font(fontdesc) // funciona pero OBSOLETO desde v 3.0
etiqueta.override_font(fontdesc) // funciona pero OBSOLETO desde v 3.16
add (etiqueta)
谢谢