Re: [Vala] Access the "klass" parameter of a class_init() function in vala with "static construct"



On Sat, Jul 31, 2010 at 11:30:19 -0700, Evan Nemerson wrote:
On Sat, 2010-07-31 at 17:59 +0200, Sébastien Wilmet wrote:
Hello!

What I want to do is to implement a GtkAction derived class which sets
GtkActionClass:toolbar_item_type to GTK_TYPE_MENU_TOOL_BUTTON in its
class_init function.

Vala doesn't currently expose *Class structs in the bindings, so AFAIK
what you're talking about can't be done easily.

Sure it can. The class_init function can be defined as 'class construct'
block.

The class can have 'class' variables, which are shared for all instances, but
separate for subclasses and 'class' methods, that take the *Class struct as
their invocant. GtkActionClass:toolbar_item_type is a case of 'class'
variable.

-- 
                                                 Jan 'Bulb' Hudec <bulb ucw cz>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]