After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 116647 - GtkNotebook: tab states
GtkNotebook: tab states
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
2.2.x
Other Linux
: Normal enhancement
: Medium API
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-07-03 18:26 UTC by Sebastian Rittau
Modified: 2016-01-24 05:53 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Sebastian Rittau 2003-07-03 18:26:17 UTC
(See bug 72101 against the GNOME HIG for a general discussion about tab
behaviour.)

Some application use colors or icons to display the state of a tabbed page.
It might be a worthwhile addition to Gtk+ to add the ability to do this easily.

API draft:

  enum _GtkNotebookState {
      GTK_NOTEBOOK_STATE_NORMAL,
      GTK_NOTEBOOK_STATE_LOADING,
      GTK_NOTEBOOK_STATE_CHANGED,
      GTK_NOTEBOOK_STATE_ATTENTION,
      GTK_NOTEBOOK_STATE_UNSAVED
  };
  typedef enum _GtkNotebookState GtkNotebookState;

  void gtk_notebook_tab_set_state(GtkNotebook *notebook, gint position,
GtkNotebookState state);
  GtkNotebookState gtk_notebook_tab_get_state(GtkNotebook *notebook, gint
position);

This could draw an appropriate icon at the tab labels. The advantage of
such an API is the ability to abstract the implementation and streamline
applications.

An alternative or an addition might be a convenience API like:

  gtk_notebook_tab_set_icon(GtkNotebook *notebook, gint position, GtkWidget
*icon);
  GtkWidget *gtk_notebook_tab_get_icon(GtkNotebook *notebook, gint position);

Please note that all this is fairly easily implementable in applications,
too, so if you don't consider this a worthwhile addition to Gtk+, don't
hesitate to close this bug. I will prepare an addition to the HIG that will
 recommend application authors to use a certain style when doing things
like these described in this proposal. This addition could be removed from
the HIG if this proposal was implemented.
Comment 1 Owen Taylor 2003-08-05 19:27:42 UTC
Not sure this make sense; strikes me as rather specialized
and it's not clear to me that every app will want exactly
the same set of states. 

I'll leave it open for the moment, however.

Maybe some simple API for notebook tab icons would be 
useful? Even there simply packing a hbox in is more general.
Comment 2 Luke Schierer 2004-12-16 20:35:05 UTC
interesting idea. looking at this from gaim's standpoint,
"GTK_NOTEBOOK_STATE_CHANGED" sounds more or less like the color change we color
gray, for status changes and the like, "GTK_NOTEBOOK_STATE_LOADING" would probly
work for typing notification (green), and "GTK_NOTEBOOK_STATE_ATTENTION" for the
(red) unseen messages we use. referencing the colors not so much as critical, as
to help visualize it how it would apply, mostly as an alternative use of this to
what looks like a fairly editor/browser centric proposal. 
Comment 3 Matthias Clasen 2006-10-16 03:10:22 UTC
*** Bug 362483 has been marked as a duplicate of this bug. ***
Comment 4 Roman Polach 2007-03-23 21:41:55 UTC
Is really bug 362483 a dupe of this? It seems that it has nothing to do with GtkNotebook..
Comment 5 Matthias Clasen 2016-01-24 05:53:17 UTC
Don't think we'll add something like this to GtkNotebook at this point