Re: [Vala] Setting up a timer with callback event



Hello,

On 19 August 2009, 14:24, Arkadi Viner wrote:
I want to write some animation in my program.
I want to be able to activate it or cancel it where ever I want.
My basic program structure looks like this:

You should describe your status if you want to get useful advice. Like
mention what is failing.

using Gtk;

public class MyApp {
[...]
}

//This should activate the timer.
  [CCode (instance_pos = -1)]

It must be an instance method to have an instance pos. So it must be inside
the class.

  public void on_btnActivate_clicked (Button source) {
[...]

//Timer listener
[CCode (instance_pos = -1)]
public delegate bool SourceFunc ()

This makes no sense. 'delegate' defines a delegate *type*, but you are
defining a function here.

Oh, and you don't need instance_pos = -1 when you connect things yourself,
because vala will create appropriate wrapper automatically. It is only needed
for the Builder.connect case, where it cannot know to create them.

I need help to fix this code so I can setup a timer properly....
I don't sure what is wrong with my code....

It's hard to help you when you didn't write whether you have compilation
problems, or wheter Gtk.Builder is complaining that it cannot connect
something or what.

-- 
                                        - Jan Hudec <bulb ucw cz>





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