Re: [Vala] Overriding Gtk.Container.forall (...)



* Sam Liddicott wrote, On 18/07/08 09:27:
* Frederik wrote, On 18/07/08 09:11:
  
Yu Feng wrote:
    
gtk_container_forall is loop over all the children (including the
internal children), it invokes
class->forall with the parameter including_internals = TRUE;

To make it clear, gtk_container_foreach has to be mentioned.
gtk_container_foreach invokes
class->forall with including_internals = FALSE.
      
I see, that makes sense.

    
I think vala's vapi generator is screwed by this strange situation:
the virtual class->forall is ignored.

I don't see any solution to the problem within the vala framework. Any
ideas?
      
One solution could be to allow inside a vapi (only there) both a
virtual and a non-virtual definition for the same method name:

virtual void forall (bool include_internals, Gtk.Callback callback);
void forall (Gtk.Callback callback);

If Vala would see that there are two definitions it could automatically
choose the virtual one for overriding and the other one for invocation.
The vapi generator would have to be aware that virtual and non-virtual
signature may differ.
    
Perhaps the virtual one would also have to be abstract?
  

I wonder if you are using the term "virtual method" when you mean "class method" ?

Sam


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