Some Text") { Use...">

How to make Gtk.Frame shortcut bold?

Usually for shortcuts you can do something like this:

Label label = new Label ("<b>Some Text</b>") {
    UseMarkup = true
};

However, the Gtk.Frame label is just a string, not a full label. I can not find an option to use markup. How to enable markup or otherwise set a shortcut?

+3
source share
3 answers

The GtkFrame label can be any widget , and you can use your own GtkLabel if you want.

+3
source

Gtk.Frame "". , LabelWidget. , Gtk.Label , .

var frmExample = new Gtk.Frame();
frmExample.LabelWidget = new Gtk.Label() { Markup = "<b>Example</b>" };
this.Add( frmExample );
this.showAll();

. , Gtk.Frame Gtk.Label, , , true.

var frmExample = new Gtk.Frame( "<b>Example</b>" );
( (Gtk.Label) this.frmExample.LabelWidget ).UseMarkup = true;
this.Add( frmExample );
this.showAll();

, .

+1

Not sure how this would look in C #, but in simple C you could do this:

  frame = GTK_WIDGET (g_object_new (GTK_TYPE_FRAME, "label", "", NULL));
  label = gtk_label_new(_("<b>Scope</b>"));
  gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
  gtk_frame_set_label_widget (GTK_FRAME(frame), label);
Run codeHide result
0
source

Source: https://habr.com/ru/post/1727016/


All Articles