Is there a workaround for Linux mono's refusal to acknowledge that I have resized the columns of my VirtualMode ListView?
صفحه اصلي

Is there a workaround for Linux mono's refusal to acknowledge that I have resized the columns of my VirtualMode ListView?



When I resize a column, it does not redraw the data with the updated alignment. I've tried Invalidating, Refreshing, and a few other things. Nothing has worked. Does anyone know a workaround? I have not tried this in mono for Windows.

To see what I mean, drop this control on a form, and run it in mono for Linux:

using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Drawing;  class MyListView : ListView {   private readonly List<ListViewItem> items_ = new List<ListViewItem>();   public MyListView()   {     VirtualMode = true;     Columns.Add("Col 1");     Columns.Add("Col 2");     Columns.Add("Col 3");     Add(new ListViewItem(new[] { "a", "b", "c" }));     Add(new ListViewItem(new[] { "a", "b", "c" }));     Add(new ListViewItem(new[] { "a", "b", "c" }));     Add(new ListViewItem(new[] { "a", "b", "c" }));     Add(new ListViewItem(new[] { "a", "b", "c" }));   }   protected override void OnRetrieveVirtualItem(RetrieveVirtualItemEventArgs e)   {     e.Item = items_[e.ItemIndex];     base.OnRetrieveVirtualItem(e);   }   public void Add(ListViewItem item)   {     items_.Add(item);     VirtualListSize = items_.Count;   }   protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)   {     e.DrawText();     base.OnDrawColumnHeader(e);   }   protected override void OnDrawSubItem(DrawListViewSubItemEventArgs e)   {     var text = ((ListViewItem.ListViewSubItem)e.SubItem).Text;     using (var brush = new SolidBrush(e.SubItem.ForeColor))     {       e.Graphics.DrawString(text, Font, brush, e.Bounds);     }     base.OnDrawSubItem(e);   }   protected override void OnColumnWidthChanged(ColumnWidthChangedEventArgs e)   {     base.OnColumnWidthChanged(e);     Invalidate(true); // Nope, that didn't work     Refresh(); // Nope, that didn't work   } } 

API to translate group name to group id (gid)

1:

What scripts should not be ported from bash to python?
I figured it out. Vim + OmniCppComplete: Completing on Class Members which are STL containers While my method of storing and reusing the ListViewItem instances works fine in Windows, mono prefers this I recreate them in the body of OnRetrieveVirtualItem.. How do I bring a processes window to the foreground on X Windows? (C++)
How communicate with pty via minicom or screen?

74 out of 100 based on 39 user ratings 634 reviews

@