Calling TreeStore.AppendValues with array of values

View: New views
2 Messages — Rating Filter:   Alert me  

Calling TreeStore.AppendValues with array of values

by pcloches :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am attempting to  call TreeStore.AppendValues with an array containing the values. However, AppendValues seems to have two conflicting definitions:

AppendValues(params object[] values)
and
AppendValues(Array values)

When I attempt to pass an array of strings for the values, the first element of the passed array gets populated for each value. I believe that even though I am passing an array, it is only taking the first value of the array because it thinks its still a variable argument call with only one variable argument. I attempted to use Type.Invoke on the method, specifying the arguments as just typeof(Array), however it still did the same thing.

Any ideas how I can overcome this?

Re: Calling TreeStore.AppendValues with array of values

by Iggy MA :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you're just passing it an array you may need to set the TreeCellDataFunc to render the values properly. There is a good example of how to do it on the mono wiki at http://www.mono-project.com/GtkSharp_TreeView_Tutorial under the section 'Controlling how the model is used'

http://iggyma.blogspot.com/



pcloches wrote:
Hello,

I am attempting to  call TreeStore.AppendValues with an array containing the values. However, AppendValues seems to have two conflicting definitions:

AppendValues(params object[] values)
and
AppendValues(Array values)

When I attempt to pass an array of strings for the values, the first element of the passed array gets populated for each value. I believe that even though I am passing an array, it is only taking the first value of the array because it thinks its still a variable argument call with only one variable argument. I attempted to use Type.Invoke on the method, specifying the arguments as just typeof(Array), however it still did the same thing.

Any ideas how I can overcome this?