title: Glib - What is the most easy way to execute a GCallback directly?
body: <p>What I currently do:</p>
  
  <pre><code>/* FIXME: Actually I just want to call that callback ... no idea how that can be done without using a signal */
  /* So I just used some random unused signal for it */
  gulong handler_id = g_signal_connect_swapped (window, "direction-changed", (GCallback) mycallback, window);
  g_signal_emit_by_name (window,"direction-changed");
  g_signal_handler_disconnect (window, handler_id);
  </code></pre>
  
  <p>Works well, but is an ugly hack.</p>
  
  <p>I know it is somehow possible to call my callback by using <code>g_closure_invoke()</code> in some way, though so far I did not get that to work.</p>
  
  <p>If it matters, the callback will be filled with a function which looks like that:</p>
  
  <pre><code>static void myCallbackMethod (GtkWindow *window);
  </code></pre>