开发者

Padding of a GtkToolButton

开发者 https://www.devze.com 2023-02-17 16:22 出处:网络
Is it possible to set the padding o开发者_开发知识库f a GtkToolButton (in my case, containing a GtkArrow)?I found a solution:

Is it possible to set the padding o开发者_开发知识库f a GtkToolButton (in my case, containing a GtkArrow)?


I found a solution:

  • Put a GtkToolItem in the toolbar (gtk_toolbar_insert).
  • Request a size: in my case, 13x36 (gtk_widget_set_size_request).
  • Put a GtkButton in the GtkToolItem (gtk_container_add).
  • Parse some GtkRC code:

    gtk_rc_parse_string(
    "style \"arrowbutton\" {\n" + // Arrows
    " xthickness = 0\n" +
    " ythickness = 0\n" +
    "}\n" +
    "widget \"*.arrowbutton\" style \"arrowbutton\"");

  • Set the name "arrowbutton" for the GtkButton (gtk_widget_set_name).
  • Put the GtkArrow (in my case) in the GtkButton (gtk_button_set_image).


Tried GtkContainer.set_border_width ?

Always follow inheritance hierarchy... for example ToolButton is a ToolItem, ToolItem is a Bin, Bin is a Container, and Container has a method set_border_width

0

精彩评论

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