[Gtk-sharp-list] TreeView Model and GetIter/GetValue

Rodolfo Campero rodolfo.campero at gmail.com
Wed Jul 6 10:17:28 EDT 2005


Hi,

On 7/6/05, Rob Hudson <rob at euglug.net> wrote:
> That didn't help.  I still get the first two errors.  Line 77 is this line:
>         TreeModel m = recipetree.Model;
> 
> It's thinking recipetree is unassigned, but yet in my constructor it has
> a value and I can use it.  Do I need to do anything special to make it
> global to all methods in the class?  Is "[Widget]" enough or do I need
> "[Glade.Widget]" or something?

Oh! I see.
The problem is that recipetree is an instance variable, but
on_recipetree_row_activated is static. So you can't reference
recipetree from within on_recipetree_row_activated, because you don't
have a "this" context. I don't remember exactly what are the rules for
event binding in glade, but try to make on_recipetree_row_activated an
instance method (not static). I hope that will solve your problem.

Best regards,
Rodolfo


More information about the Gtk-sharp-list mailing list