Re: Making GtkMenuMerge nice to demo



Am Mon, 2003-08-25 um 22.29 schrieb Owen Taylor:
> Here's some thoughts I wrote down yesterday looking at appwindow.c;
> my basic premise is that if we can't write a demo that looks easy
> to use and understand, then the API needs some changes.
> 

Thanks for the detailed feedback. So to summarise your proposals:

1) Replace GtkActionGroupEntry and GtkActionGroupEntryType by

struct GtkActionEntry 
{
  gchar *name;
  gchar *stock_id;
  gchar *label;
  gchar *accelerator;
  gchar *tooltip;

  GCallback callback;

  gboolean is_toggle;
}

struct GtkRadioActionEntry 
{
  gchar *name;
  gchar *stock_id;
  gchar *label;
  gchar *accelerator;
  gchar *tooltip;

  guint  value; 
}

add a user_data argument to gtk_action_group_add_actions(), a separate
method
                        
gtk_action_group_add_radio_actions (GtkActionGroup      *action_group,
			            GtkRadioActionEntry *entries,
                                    guint               n_entries,
                                    GCallback           on_changed,
                                    gpointer            user_data)

and _full variants of these. Then we also need a ::changed signal on
GtkRadioMenuItem and GtkRadioToolItem, a value property on
GtkRadioAction and a gtk_radio_action_get_current_value()

2) Rename GtkMenuMerge to GtkUIManager

3) Rework the XML format:
  - rename <Root> to <ui> and make it optional in strings
  - rename <dockitem> to <toolbar>
  - rename <menu> to <menubar>, <submenu> to <menu>
  - rename verb to action
  - perhaps allow to disambiguate actions by prepending group_name::

5) Don't use N_() and ::add_widget in gtk-demo, instead use get_widget()


These all sound very reasonable. To 3) I'd like to add: get rid of
<popups>, it adds an ugly asymmetry and isn't really necessary.

Matthias




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