开发者

Padding of a GtkToolButton

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜