lua-users home
lua-l archive

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


Hi Pavel,

Yes, I had a look on the .gir, but I only focused on arg definitions :(
In any cases, I don't see any rename-to :

    <function name="timeout_add_seconds"
              c:identifier="g_timeout_add_seconds"
              shadowed-by="timeout_add_seconds_full"
              version="2.14"
              introspectable="0">
      <doc xml:whitespace="preserve">... documentation ...</doc>
      <return-value transfer-ownership="none">
        <doc xml:whitespace="preserve">the ID (greater than 0) of the event source.</doc>
        <type name="guint" c:type="guint"/>
      </return-value>
      <parameters>
        <parameter name="interval" transfer-ownership="none">
          <doc xml:whitespace="preserve">the time between calls to the function, in seconds</doc>
          <type name="guint" c:type="guint"/>
        </parameter>
        <parameter name="function" transfer-ownership="none" closure="2">
          <doc xml:whitespace="preserve">function to call</doc>
          <type name="SourceFunc" c:type="GSourceFunc"/>
        </parameter>
        <parameter name="data" transfer-ownership="none">
          <doc xml:whitespace="preserve">data to pass to @function</doc>
          <type name="gpointer" c:type="gpointer"/>
        </parameter>
      </parameters>
</function>

So is it the shadowed-by that create the behavior you explained ?

Thanks for your code : it is working pretty well :) but is raising also some (probably) stupid question to me :
How can I mix both Glib and Gtk ? I mean, I can't have both
    main_loop:run()
and
    Gtk.main()

But more, how can I having a process running and checking if some evens has to be handled ?
I mean, my main experience with GUI programming is on AmigaOS where you can use a main loop like here, but you can have also a plain process working, checking punctually for arriving events or be interrupted by signals.

Something like :

for(;;){
    ImDoingSomeHardWork();
    if(waiting_events)
        EventsHandler();
    SomeOtherHardWork();
}

How it is possible with GLib and Gtk ?

Thanks

Laurent