GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TreevIew columns not showing.

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
clash
Familiar Face


Joined: 17 Jan 2007
Posts: 5

PostPosted: Thu Jan 18, 2007 4:47 pm    Post subject: TreevIew columns not showing. Reply with quote

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: (Plaintext)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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]
Back to top
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 465
Location: Portland, OR USA

PostPosted: Thu Jan 18, 2007 8:34 pm    Post subject: Reply with quote

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: (Plaintext)
1
2
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: (Plaintext)
1
treeView.FixedHeightMode = false;
Back to top
clash
Familiar Face


Joined: 17 Jan 2007
Posts: 5

PostPosted: Fri Jan 19, 2007 3:50 pm    Post subject: Reply with quote

Thanks a million that sorted it :)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP