Re: What is acceptable as an action proxy ?



Matthias Clasen <maclas gmx de> writes:

> Am Fre, 2003-08-29 um 16.42 schrieb Owen Taylor:
>> On Wed, 2003-08-27 at 19:53, Matthias Clasen wrote:
>> > Currently, GtkActions can connect to toolbuttons and menuitems. It would
>> > be very easy to make this work for regular buttons as well. While I
>> > don't think it makes a lot of sense to generate the buttons from an
>> > XML ui description, being able to write
>> > 
>> >   button = gtk_toggle_button_new ();
>> >   action = gtk_action_group_get_action (action_group, "toggle-cnp");
>> >   gtk_action_connect_proxy (action, button);
>> > 
>> > and have the button automatically activate the same action as the
>> > corresponding menu and toolbar entries and monitor the sensitivity of
>> > the action might be handy.
>> > 
>> > What do you think about this ?
>> 
>> It don't really see this as being that useful. When are you thinking
>> you would want this?
>> 
>
> I don't have a concrete use case in mind. It was more a principal
> consideration that once you have a model-view separation for menus and
> toolbars based on actions, it makes sense to allow buttons to be views
> of actions as well. Maybe you're right that the situations where it
> would be useful are rare.

But I have a use case in mind: When creating wizards or complex
special purpose dialogs, having a button as view of an action can be
very useful. Consider the following:

  "You have done the wrong thing since blah..."

  [ Do the Right thing ]

"Do the Right Thing" is a button which will invoke the action the user
was supposed to trigger in that context.

A real world example is the "Create Path from Text" button in the
GIMP's new text tool options. Ideally, the "Text to Path" action
should be allowed to be triggered from a menu in the image window, a
popup and maybe a toolbar button in the layers dialog, from the
mentioned button in the tool options, and from *any* widget that can
"activate" itself.

Likewise, toggle and radio actions should be able to connect to
anything that has the toggle/radio behaviour, so I vote for adding the
code that allows writing code like in the example above.

ciao,
--mitch



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