Friday, November 05, 2021

October News...

 2021-10:
gnocl::text
o insertImage command enhanced to follow the insert command for text, ie..
$wid insertImage <pos> <imagename> -tags <taglist>
Where image can take a standard image %-markup prefix
gnocl::pango
o new subcmds, markup2options, options2markup
attempts to convert a pango markup string <span> tag to a list of text attibutes e.g., 
gnocl::pango markup2option "<span foreground='red' background='blue'>"  
returns 
{-foreground "red" -background "blue"}
gnocl::pango option2markup {-foreground "red" -background "blue"} 
returns
"<span foreground='red' background='blue'>"
created strings.h header file, keep decls for project string utilites
gnocl::text
o tag 
  new sub command - return character tag properties as pango markup
  new options -underlineColor, -strikethroughColor, not used by widget,
but passed as a pango attribute.
gnocl::canvas
o new command clear, remove all items from canvas.
o new text item options: -clip, -clipHeight, -clipWidth, 
  -fontRise, -fontSizePoints, -fontStrikethough, -markup, 
  -textHeight, -textWidth
gnocl::text
o tag ranges issues resolved.
gnocl::labelWidget
o issues with widget commands now resolved.
gnocl::button
o new option -onDestroy
gnocl::dialog
o removed redundant -modal option, dialog widgets are modal by default

First Attempt at Accessing GObject Private Data - FAILED

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