Re: stock system



Havoc Pennington wrote:


> --- gtk/gtkbutton.h     2000/07/26 11:32:42     1.12
> +++ gtk/gtkbutton.h     2000/07/26 22:00:32
> @@ -75,7 +75,11 @@
> 
>  GtkType        gtk_button_get_type       (void);
>  GtkWidget*     gtk_button_new            (void);
> -GtkWidget*     gtk_button_new_with_label (const gchar *label);
> +GtkWidget*     gtk_button_new_with_label (const gchar   *label);
> +GtkWidget*     gtk_button_new_stock      (const gchar   *stock_id,
> +                                          GtkAccelGroup *accel_group);
> +GtkWidget*     gtk_button_new_accel      (const gchar   *uline_label,
> +                                          GtkAccelGroup *accel_group);
>  void           gtk_button_pressed        (GtkButton *button);
>  void           gtk_button_released       (GtkButton *button);
>  void           gtk_button_clicked        (GtkButton *button);


>From a GUI builder perspective it would be nice to have a "stock_id"
property, which you could change either via a function call or a GtkArg.
It would remove any current contents and recreate them.
The default value of stock_id would be NULL, and if the button's
child was removed the stock_id would be reset to NULL. I suppose that
the GtkButton struct would need a stock_id field added.

Similarly it would be nice to have a "label" property.
When the property is set the button's current contents would be removed
and a new label would be added (unless the button's child is already a label).
Getting the property would return NULL if the child isn't a label.


One-shot utility functions to setup widgets create problems for GUI
builders. It's better to think in terms of objects/widgets and properties
(and Delphi/VB-like object inspectors).


Oh, we'd also need a way to iterate through all the available stock
items, so we can show them in the property editor (with icons if possible).
I didn't spot any way to do this at a quick glance.

Damon





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