Re: API for putting close buttons on tabs (proposal)



Alexander Semenov wrote:
Hi all.

I think that GtkNotebook API is missing methods for putting close buttons on tabs. Different implementations of this task look different and sometime ugly. It could be cool to add methods such as "gtk_notebook_tab_s(g)et_close_button_visible (...)" to the standard API. What does the community think about this?

Alexander Semenov <bohtvaroh gmail com>


I propose the following API:

/* Set|get action area content for a tab */
void gtk_notebook_set_action_area (GtkNotebook *notebook, GtkWidget *action_area, gint at_position); GtkWidget * gtk_notebook_get_action_area (GtkNotebook *notebook, gint at_position);

/* Globally show|hide action areas on tabs */
void gtk_notebook_set_show_action_areas (GtkNotebook *notebook, gboolean show);
gboolean gtk_notebook_get_show_action_areas (GtkNotebook *notebook);

/* Show|hide action area for a tab */
void gtk_notebook_set_show_action_area (GtkNotebook *notebook, gboolean show, gint at_position); gboolean gtk_notebook_get_show_action_area (GtkNotebook *notebook, gint at_position);

/* Predefined action area types */
typedef enum
{
    GTK_NOTEBOOK_ACTION_AREA_CLOSE
    /* other types */
} GtkNotebookActionAreaType;

/* Set|get action area content for a tab by type */
void gtk_notebook_set_action_area_type (GtkNotebook *notebook, GtkNotebookActionAreaType type, gint at_position);


What do you think about?

Alexander Semenov <bohtvaroh gmail com>


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