I think you can try to use g_strchug and g_strchomp to remove all blank space in your string.
David Hampton <[EMAIL PROTECTED]> 写道:I'm having problems with data alignment in a tree view column in gtk-2.4. I can get the data right aligned by either setting the xalign property on the tree column (and using a column in the model to set the alignment to 1.0) or directly setting the xalign property on the cell renderer to the value 1.0. Either way the column comes out looking like this: +---------+ | Value| +---------+ | x.xx| | xxx.xx| |xx,xxx.xx| +---------+ All good so far. My problem is that when I resize the column, the data now looks like this: +----------------+ | Value| +----------------+ | x.xx | | xxx.xx | |xx,xxx.xx | +----------------+ The column label is still correctly right aligned, but the data is no longer right aligned. Its appears to still aligned based upon the earlier size of the column. (Or maybe based on the maximum sized data string displayed.) I've tried catching the "size-allocate" signal from the view, finding the new column width, and setting the width property on the cell renderer. I've tried catching that signal and calling gtk_cell_renderer_set_fixed_size() on the renderer. Neither has any effect on where the data is placed in the column. Interestingly enough, using gtk_cell_renderer_set_fixed_size() at the time the renderer is created will give me a very very wide column with the data right aligned. Using this function from a callback seems to have no effect. Does anyone know if getting the data to be right aligned in a resized column is possible? I'd appreciate any pointers. David _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list --------------------------------- Do You Yahoo!? 150万曲MP3疯狂搜,带您闯入音乐殿堂 美女明星应有尽有,搜遍美图、艳图和酷图 1G就是1000兆,雅虎电邮自助扩容! _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list