コード例 #1
0
            protected override void OnRender(Context cr, Gg.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gg.CellRendererState flags)
            {
                if (flags.HasFlag(Gg.CellRendererState.Focused))
                {
                    var dataItem  = Handler.Source.GetItem(row);
                    var dataStore = Handler.Widget.DataStoreBinding.GetValue(dataItem);
                    if (Handler.currentDataStore == null || !dataStore.Cast <string>().SequenceEqual(Handler.currentDataStore.Cast <string>()))
                    {
                        Handler.listStore.Clear();
                        foreach (var item in dataStore)
                        {
                            Handler.listStore.AppendValues(Handler.Widget.ComboTextBinding.GetValue(item), Handler.Widget.ComboKeyBinding.GetValue(item));
                        }
                        Handler.currentDataStore = dataStore.ToArray();
                    }
                }

                base.OnRender(cr, widget, background_area, cell_area, flags);
            }
コード例 #2
0
 protected override void OnGetPreferredHeight(Gg.Widget widget, out int minimum_size, out int natural_size)
 {
     base.OnGetPreferredHeight(widget, out minimum_size, out _);
     natural_size = Handler.Source.RowHeight;
 }