Index: trunk/src_plugins/hid_lesstif/xm_tree_table_widget.c =================================================================== --- trunk/src_plugins/hid_lesstif/xm_tree_table_widget.c (revision 23001) +++ trunk/src_plugins/hid_lesstif/xm_tree_table_widget.c (revision 23002) @@ -509,19 +509,15 @@ } } -int xm_tt_set_x11_font_attr(Widget xm_tree_table, const char *attributes) +void xm_tt_set_x11_font(Widget xm_tree_table, XFontStruct *new_font) { - XFontStruct *new_font = XLoadQueryFont(XtDisplay(xm_tree_table), attributes); if (!new_font) - return -1; + return; XM_TT_LOCKED_CODE(xm_tree_table, tw, tp, - if (tp->font) - XFreeFont(XtDisplay(xm_tree_table), tp->font); tp->font = new_font; - xm_extent_prediction(tw); - tp->render_attr.vertical_stride = TTBL_MAX(tp->n_max_pixmap_height, GET_FONT_HEIGHT(tp->font)); + tp->render_attr.vertical_stride = TTBL_MAX(tp->n_max_pixmap_height, GET_FONT_HEIGHT(tp->font)); + xm_extent_prediction(tw); ) - return 0; } void xm_attach_tree_table_header(Widget w, unsigned n_strings, const char **strings) Index: trunk/src_plugins/hid_lesstif/xm_tree_table_widget.h =================================================================== --- trunk/src_plugins/hid_lesstif/xm_tree_table_widget.h (revision 23001) +++ trunk/src_plugins/hid_lesstif/xm_tree_table_widget.h (revision 23002) @@ -166,14 +166,10 @@ w - must be an instance returned by xm_create_tree_table_widget(). */ void xm_draw_tree_table_widget(Widget w); -/* Set font attributes like "-bitstream-courier 10 pitch-medium-r-*-*-*-*-*-*-*-*-*-1". -Affects whole widget (header, table cells), takes effect on next re-draw event: -when resized of manual invocation of xm_draw_tree_table_widget(). -Function does NOT re-draw, use xm_draw_tree_table_widget() for that. +/* Set font struct, caller is responsible for freeing it, after the widget has been destroyed. +The default used is from XmeRenderTableGetDefaultFont(). */ +void xm_tt_set_x11_font(Widget xm_tree_table, XFontStruct *new_font); -Returns 0 on success, -1 otherwise. */ -int xm_tt_set_x11_font_attr(Widget xm_tree_table, const char *attributes); - /* can be optionally used to lock the access on rendering refresh*/ typedef struct tt_table_access_cb_s { /* optional things. */