How do Valas closures map to Genie?

后端 未结 2 1248
耶瑟儿~
耶瑟儿~ 2021-01-05 18:03

The Vala Tutorial has an example about DBus using anonymous methods.

Bus.own_name (BusType.SESSION, \"org.example.DemoService\", /* name to register */
              


        
2条回答
  •  梦谈多话
    2021-01-05 18:28

    I think there is not way. You must call another process using "def".

    Bus.own_name (BusType.SESSION, "org.example.DemoService", 
              BusNameOwnerFlags.NONE, 
              on_bus_aquired, 
              reg,
              err);
    
    def reg()
        pass
    
    def err()
        print "error"
    

提交回复
热议问题