[Gtk-sharp-list] ComboBox display problem

Bryan Buchanan adslh3nu at tpg.com.au
Thu Jun 30 21:23:39 EDT 2005


Hi,

When the number of items in a ComboBox needs to scroll, there can
sometimes be blank space displayed in the popup menu. The code below
demonstrates it. Start the prog, move the window to near the bottom of
the screen and click the combo. Blank space will display in the pop-up
menu and the items in the popup scroll into the blank space.

Is there a way to stop this ?

Thanks,

Bryan

// mcs test.cs -r:System.Data -pkg:gtk-sharp-2.0
using System; 
public class Test {
  public static void Main (string [] args) {
    new Test(args);
  }
  public Test(string [] args) {
   Gtk.Application.Init ();
 
   Gtk.Window win = new Gtk.Window(Gtk.WindowType.Toplevel);
   win.DeleteEvent += new Gtk.DeleteEventHandler (DeleteEventCb);
   win.Title = "Test";
 
   Gtk.ComboBox combo = new Gtk.ComboBox();
   Gtk.ListStore model = new Gtk.ListStore (typeof(string), t
ypeof(int));
   Gtk.CellRendererText renderer = new Gtk.CellRendererText ();
   combo.Model = model;
   combo.PackStart(renderer, true);
   combo.AddAttribute(renderer, "text", 0);
   combo.ColumnSpanColumn = 1;
   combo.RowSpanColumn = 1;
 
   // fill in the liststore
   for(int i=0; i<30; i++) {
     model.AppendValues("description " + i, 1);
   }

   win.Add (combo);
   win.ShowAll ();
 
   Gtk.Application.Run ();
 }
 void DeleteEventCb (object o, Gtk.DeleteEventArgs args) {
   Gtk.Application.Quit ();
   args.RetVal = true;
 }
}




More information about the Gtk-sharp-list mailing list