[Vala] [Genie] Convert Python to Genie



Hi,

I need help, i try to convert code from python to genie and i want to know if it's good or not.

Python code:

       iter = self.layout.get_iter()
       i=0
       while 1:
           if i > start_line:
               line = iter.get_line()
               cr.rel_move_to(0, self.font_size/2)
               cr.show_layout_line(line)
           i += 1
           if not (i < end_line and iter.next_line()):
               break

Genie code:

       iter : weak Pango.LayoutIter = layout.get_iter()
       var i = 0
       while i == 1
           if i > start_line
               var line = iter.get_line()
               cr.rel_move_to(0, font_size/2)
               Pango.cairo_show_layout_line(cr, line)
           i+= 1
           if not (i < end_line and iter.next_line())
               break

Is it correct ?

Thanks in advance,
Nicolas.




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