When the toolbar is placed in the vertical alignment widget texts are still centred. I thought that making these alignable might be more aesthically pleasing. I didn't complete the job, but I did glean a little bit more on just how to access widget private data. It all seems to pivot around the G_TYPE_INSTANCE_GET_PRIVATE macro.
#if 1 /* ATTEMPT TO LEFT ALIGN BUTTON TEXT */ struct _GtkToolButtonPrivate { GtkWidget *button; gchar *stock_id; gchar *icon_name; gchar *label_text; GtkWidget *label_widget; GtkWidget *icon_widget; GtkSizeGroup *text_size_group; guint use_underline : 1; guint contents_invalid : 1; }; typedef struct _GtkToolButtonPrivate GtkToolButtonPrivate; struct _GtkToolButton { GtkToolItem parent; /*< private >*/ GtkToolButtonPrivate *GSEAL (priv); }; #define GTK_TOOL_BUTTON_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_TOOL_BUTTON, GtkToolButtonPrivate)) GtkToolButton *button; GtkToolButtonPrivate *priv; priv = GTK_TOOL_BUTTON_GET_PRIVATE (para->item); GtkWidget *label = priv->label_widget; gtk_misc_set_alignment (label,0.0,0.5); #endif
Comments