Ejemplo n.º 1
0
static void _check_paned (AtkObject *obj)
{
  static gboolean done_paned = FALSE;
  AtkRole role;

  role = atk_object_get_role (obj);

  if (role == ATK_ROLE_FRAME)
  {
    AtkRole roles[NUM_VALID_ROLES];
    AtkObject *paned_obj;

    if (done_paned)
      return;

    roles[0] = ATK_ROLE_SPLIT_PANE;

    paned_obj = find_object_by_role (obj, roles, NUM_VALID_ROLES);

    if (paned_obj)
    {
      if (!done_paned)
      {
        done_paned = TRUE;
      }
      atk_object_connect_property_change_handler (paned_obj,
                   (AtkPropertyChangeHandler*) _property_change_handler);
      gtk_timeout_add (2000, _test_paned, paned_obj);
    }

    return;
  }
  if (role != ATK_ROLE_COMBO_BOX)
    return;
}
Ejemplo n.º 2
0
static void _add_handler (AtkObject *obj)
{
  static GPtrArray *obj_array = NULL;
  gboolean found = FALSE;
  gint i;

  /*
   * We create a property handler for each object if one was not associated 
   * with it already.
   *
   * We add it to our array of objects which have property handlers; if an
   * object is destroyed it remains in the array.
   */
  if (obj_array == NULL)
    obj_array = g_ptr_array_new ();
 
  for (i = 0; i < obj_array->len; i++)
  {
    if (obj == g_ptr_array_index (obj_array, i))
    {
      found = TRUE;
      break;
    }
  }
  if (!found)
  {
    atk_object_connect_property_change_handler (obj,
                   (AtkPropertyChangeHandler*) _value_change_handler);
    g_ptr_array_add (obj_array, obj);
  }
}