Re: GtkBuilder status



Tristan Van Berkom wrote:

I'm afraid I'll have to take at least one day to better my knowlage about
exactly how GtkAction works, but from the little I already know and my first glances... I dont see why the menu items cant be prefabricated with actions attached,
and the action groups made available by the GtkMergable implementors
(allowing for seemless integration of get_accel_group() and such).

I will delve a little further into the action code and come up with something
a little more solid...

Now that I've taken a moment to take a closer look at GtkActions... I feel a little
more enthusiastic :-)

I would propose we take the following steps to use GtkAction without using UIManager:

o Make GtkAction available to GtkButton, GtkToggle/CheckButton, GtkRadioButton
  and any other GtkWidgets that make sence

o A widget should be able to register to an existing action via a property either on the GtkWidgetClass itself or some GtkActivatableIface. Setting this "action" property on a widget should result in its getting registered to the action's proxy list (and unregistered from the previously connected action ofcourse).

o As mentioned in the previous mail... action groups can be made available by the Mergable, but I would propose that they be provided by GtkContainer... which can now simply recurse over the hierarchy and collect the actions at any desired level of the heirarchy; GtkWindows could be made to setup its accel_group without
  any added code too (if so desired).

o A decision would have to be made here to either depricate the following apis
  along with the UIManager:

GtkWidget*  gtk_action_create_menu_item     (GtkAction *action);
GtkWidget*  gtk_action_create_tool_item     (GtkAction *action);

  or to add an api:

GtkWidget*  gtk_action_create_widget     (GtkAction *action);

for the cases where it would create a regular button, toggle, radio or whatnot, I dont see any reason to create widgets based on actions without the need to build menus
  using UIManager though.

Note that extending the actions themselves represents a little work that has to be done, but that extention isnt really required yet. The point here is just that actions are usefull as an abstraction between the UI and buissiness logic of any
app, so they probably shouldnt be limited to only menus and toolbars.

Cheers,
                                          -Tristan




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