开发者

Gtk# Embed TextView in ToolBar

开发者 https://www.devze.com 2023-03-19 10:01 出处:网络
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

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消