Re: Actions for GailButton



Padraig,

My comments below.

At 05:52 PM 7/12/2001 +0100, Padraig O'Briain wrote:
Marc,

I have examined the proposed actions and my findings are below; comments
requested.

I think we need three actions:

GtkButton.press
GtkButton.release
GtkButton.activate

Pressed
=======
I assume that this action should simulate a button press. I am calling this
action GtkButton.press.

I have implemented this as follows:

      button->in_button = TRUE;
      gtk_button_enter (button);
      gtk_button_pressed (button);

That is, it simulates the mouse moving into the button followed by
pressing the left mouse button.

*** Looks right to me

Released
========
I am calling this action GtkButton.release.

There are two cases to consider here, the mouse being released inside and
outside the button.

The mouse button being released outside the button can be implemented as

      button->in_button = FALSE;
      gtk_button_leave (button);
      gtk_button_released (button);

The mouse button being released inside the button can be implemented
as part of the click action.

** Again, looks right.

Clicked
=======
Initially the click action was simple, just call gtk_button_clicked (button);
now this action could be called after GtkButton.press action. I now have
the following implementation:

      if (button->button_down)
      {
        button->in_button = TRUE;
        gtk_button_enter (button);
        gtk_button_released (button);
      }
      else
        gtk_button_clicked (button);


Activate
========
I call this GtkButton.activate and it is implemented as

      gtk_widget_activate (GTK_WIDGET (widget));

This action seems to have the same effect as GtkButton.click and should,
I think, be used instead of it.

** My only response to this discussion is that I wonder how much semantic information screen readers/other assistive tech will try to glean from these action names. Herein, I think, lies the importance of names such as "click" and "toggle" rather than "activate". What does everyone else think?


Marc





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