Re: [Java-gnome-developer] Strange error mesage when using treeView
Brought to you by:
afcowie
From: Kyrre N. S. <ky...@so...> - 2006-06-22 11:30:42
|
Yeah, i found out. Annother angel on the list was at my mailbox before you :) I changed the code to: private void setupTreeView () { //Setup the backend storage //DataColumn[] columns = new DataColumnString[1]; datacolumn0 = new DataColumnString (); channellist = new ListStore(new DataColumn[] {datacolumn0}); channellistWidget.setModel(channellist); //Setup the visual appearance of the treeView TreeViewColumn col0 = new TreeViewColumn (); CellRendererText render0 = new CellRendererText (); col0.packStart(render0, true); col0.setTitle("Channel name"); col0.addAttributeMapping(render0, CellRendererText.Attribute.TEXT, datacolumn0); channellistWidget.appendColumn(col0); //General setup of the widget channellistWidget.setEnableSearch(true); channellistWidget.setAlternateRowColor(true); channellistWidget.setHeadersVisible(false); } And now it works :) --- Kyrre tor, 22.06.2006 kl. 13.16 skrev Andrew Cowie: > On Thu, 2006-06-22 at 11:24 +0200, Kyrre Ness Sjobak wrote: > > > TreeViewColumn col0 = new TreeViewColumn(); > > CellRendererText render0 = new CellRendererText(); > > col0.setTitle("Channel name"); > > col0.addAttributeMapping(render0, CellRendererText.Attribute.TEXT, datacolumn0); > > No biggie. You missed out a step. You have to pack the CellRenderer into > the TreeViewColumn. Add something like > > col0.packStart(render0, true) > > evidently before you call the TreeView's appendColumn(). > > [I was actually under the impression that you had to call it before you > call the TreeViewColumn's addAttributeMapping(). Do let me know if > that's the case] > > > What does it mean? I don't understand... > > Errors like that bubbling out of GTK are usually because you're using it > improperly. Over time, I hope we can catch this sort of thing at the > Java layer before passing down through JNI to the C GTK library. For > now, we should certainly update the javadoc a bit! > > > Its all GPL, so it isn't any problem :) > > Good show. > > AfC > Sydney |