简体   繁体   中英

Gtk# Embed TextView in ToolBar

Is there any way to embed a TextView widget in a ToolBar? I am using Gtk# with C# on mono in Linux.

I recently had to do this for a project and was able to accomplish by manually setting the Width and Height Request. Putting the TextView in a HBox (or similar) also works.

    Toolbar _toolBar = new Toolbar();

    TextView t = new TextView();
    t.WidthRequest = 200;
    t.HeightRequest = 20;
    _toolBar.Add(t);

    t.Buffer.Text = "Hello World!";
    t.Visible = true;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM