Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override void get_preferred_width (Widget widget,
- out int min_width,
- out int nat_width) {
- int xpad=0;
- TreeView tree = widget as TreeView;
- TreeViewColumn column = tree.get_column(0);
- default_width = column.width;
- nat_width = min_width = column.width;
- }
- public override void get_preferred_height_for_width (Widget widget,
- int width,
- out int minimum_height,
- out int natural_height) {
- int a;
- Pango.Rectangle rect;
- Pango.Layout layout = widget.create_pango_layout(text);
- layout.set_width(width*Pango.SCALE);
- layout.set_wrap(Pango.WrapMode.WORD);
- layout.get_pixel_size(null, out a);
- if ( a < 100 ) {
- minimum_height = a;
- natural_height = a;
- TreeView tree = widget as TreeView;
- TreeViewColumn column = tree.get_column(0);
- column.queue_resize();
- }
- else {
- minimum_height = 100;
- natural_height = 100;
- }
- print("%d %d\n", minimum_height, natural_height);
- }
- public override void get_preferred_height (Widget widget,
- out int minimum_size,
- out int natural_size) {
- int min_width;
- get_preferred_width (widget, out min_width, null);
- get_preferred_height_for_width (widget, min_width,
- out minimum_size, out natural_size);
- print("minimum size %d\n", minimum_size);
- }
Add Comment
Please, Sign In to add comment