Пример #1
0
static gboolean
hn_others_button_button_release (GtkWidget *widget,
			         GdkEventButton *event,
			         HNOthersButton *button)
{
  /* This has to be done in the release handler, not the press handler,
   * otherwise the button gets toggled when there is no corresponding release
   * event, or worse, before the release event arrives (in which case, the
   * release event is passed to the open menu).
   */
  if (button->priv->collapse_id <= 0)
  {
    hd_wm_activate (HD_TN_DEACTIVATE_KEY_FOCUS);

    button->priv->collapse_id =
            g_timeout_add (100,
            	           (GSourceFunc) hn_others_button_press_collapser,
            	           button);
  }

#ifdef HAVE_LIBHILDON
  if (hildon_helper_event_button_is_finger (event))
#else
  if (hildon_button_event_is_finger (event))
#endif
    button->priv->thumb_pressed = TRUE;

  return TRUE;
}
gboolean
on_button_press                                 (GtkWidget *widget, 
                                                 GdkEventButton *event)
{
    HildonNote *note;
    if (hildon_helper_event_button_is_finger (event)) 
        note = HILDON_NOTE (hildon_note_new_information (NULL, "You clicked with finger!"));
    else
        note = HILDON_NOTE (hildon_note_new_information (NULL, "You clicked with stylus!"));

    gtk_dialog_run (GTK_DIALOG (note));
    gtk_object_destroy (GTK_OBJECT (note));

    return TRUE;
}