GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Apr 24, 2014 10:02 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: TreevIew columns not showing.
PostPosted: Thu Jan 18, 2007 4:47 pm 
Offline
Familiar Face

Joined: Wed Jan 17, 2007 6:26 pm
Posts: 5
Hey all, i'm using Monodevelop, the gui designer is stetic. I "drew" a basic window with some widgets. I added a treeView (called treeView) to the window and i'm assuming the code below should add columns to it. But no it doesn't :(

I keep getting this error.

Gtk-CRITICAL **: gtk_tree_view_insert_column: assertion `gtk_tree_view_column_get_sizing (column) == GTK_TREE_VIEW_COLUMN_FIXED' failed

p.s > Yes i am calling setupTreeView(), i just posted the relevant code.

Code:
using System;
using System.IO ;
using Gtk;
using System.Net;

using System.Net.Sockets;

public class MainWindow: Gtk.Window
{
   
   protected Gtk.TreeView treeView;

   public MainWindow (): base ("")
   {
      Stetic.Gui.Build (this, typeof(MainWindow));
      
      Gtk.TreeView treeView = new Gtk.TreeView ();
      
   }
   
   public void setupTreeView()
   {
   
      Gtk.TreeView treeView = new Gtk.TreeView();
      Gtk.ListStore emailList = new Gtk.ListStore (typeof (string),  typeof (string));
   
      Gtk.TreeViewColumn sender = new Gtk.TreeViewColumn ();
      sender.Title = "Sender";

      Gtk.TreeViewColumn subject = new Gtk.TreeViewColumn ();
      subject.Title = "Subject";

      treeView.AppendColumn(sender);
      treeView.AppendColumn(subject);

      treeView.Model = emailList;   

   }
}
[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 8:34 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
Quote:
Gtk-CRITICAL **: gtk_tree_view_insert_column: assertion `gtk_tree_view_column_get_sizing (column) == GTK_TREE_VIEW_COLUMN_FIXED' failed


I'm not workin in mono myself, but this error seems to be saying that you need to set the column sizing to fixed. From the GTK API for the gtk_tree_view_insert_column() function:


Quote:
This inserts the column into the tree_view at position. If position is -1, then the column is inserted at the end. If tree_view has "fixed_height" mode enabled, then column must have its "sizing" property set to be GTK_TREE_VIEW_COLUMN_FIXED.


Therefore, you can probably specify a fixed sizing using something like:
Code:
sender.Sizing = Fixed;
subject.Title = Fixed;


Here's the mono docs for it since I don't know mono: http://www.go-mono.com/docs/index.aspx?link=T%3AGtk.TreeViewColumn

Or you can disable "fixed height mode" using something like:
Code:
treeView.FixedHeightMode = false;

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 19, 2007 3:50 pm 
Offline
Familiar Face

Joined: Wed Jan 17, 2007 6:26 pm
Posts: 5
Thanks a million that sorted it :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group