Re: [Vala] I'm missing Java's anonymous classes

2011-08-05 Thread Jim Peters
Nor Jaidi Tuah wrote: > > The compiled code is something like this (from memory): > > > >self = uazu_win_widget_construct(uazu_win_display_relayout_imp, self); > > > > i.e. the delegate is a dual-pointer (func, target), with 'self' as the > > second part. But 'self' hasn't yet been initialis

Re: [Vala] I'm missing Java's anonymous classes

2011-08-05 Thread Nor Jaidi Tuah
> The compiled code is something like this (from memory): > >self = uazu_win_widget_construct(uazu_win_display_relayout_imp, self); > > i.e. the delegate is a dual-pointer (func, target), with 'self' as the > second part. But 'self' hasn't yet been initialised, because the > widget construc

Re: [Vala] I'm missing Java's anonymous classes

2011-08-05 Thread Jim Peters
Nor Jaidi Tuah wrote: > > This seems okay so far, but here comes the killer: > > > > public class Display : Widget { > > public Display() { > > base(relayout_imp); > > } > > private void relayout_imp() { ... } > > } > > > > This crashes when relayout() is called because

Re: [Vala] I'm missing Java's anonymous classes

2011-08-05 Thread Nor Jaidi Tuah
> This seems okay so far, but here comes the killer: > > public class Display : Widget { > public Display() { > base(relayout_imp); > } > private void relayout_imp() { ... } > } > > This crashes when relayout() is called because the 'relayout_imp' > argument to the cons

[Vala] I'm missing Java's anonymous classes

2011-08-05 Thread Jim Peters
This is an inconvenience rather than a project-killer, but still ... I know that the Java page suggests that instead of using anonymous classes, to use delegates, but it just doesn't work out as hoped. For example (much simplified): public abstract class Widget : Object { public abstract

Re: [Vala] How to use Game loop style with Glib main loop(for events)?

2011-08-05 Thread Tal Hadad
The first approach seems basic and very good, but I'm just wondering about asnc... You've got me wrong there, I don't want to block glib main loop and wait until it finishes rendering, I just wonder about this behavior: Suppose that user move forward when he press "w" in speed of 2(m)/(s) . Now

Re: [Vala] How to use Game loop style with Glib main loop(for events)?

2011-08-05 Thread Levi Bard
> Thank you. If I get you right, this will block events until I finish drawing, > but that is the purpose. > And is it possible to do it multi-threaded? In a way that input thread is > different than drawing thread? Well, the glib mainloop always needs to be on the thread where glib is initializ