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 64432 - GtkDialog should have accessors
GtkDialog should have accessors
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other Linux
: Normal enhancement
: Small API
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 588339
 
 
Reported: 2001-11-13 02:05 UTC by Mark Patton
Modified: 2009-07-11 23:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
here we go (2.69 KB, patch)
2007-04-01 14:02 UTC, Emmanuele Bassi (:ebassi)
none Details | Review

Description Mark Patton 2001-11-13 02:05:58 UTC
I think there should be accessors for the vbox and action_area members of
GtkDialog. Gtk seems to be moving away from accessing widget fields
directly and it makes LB authors lives easier.

Two names that spring to mind are gtk_dialog_get_contents and
gtk_dialog_get_action_area.
Comment 1 Emmanuele Bassi (:ebassi) 2007-04-01 14:00:03 UTC
we should really do this, especially in preparation for the 3.0 'clean-up-public-members-of-structs-from-hell' effort.
Comment 2 Emmanuele Bassi (:ebassi) 2007-04-01 14:02:00 UTC
Created attachment 85656 [details] [review]
here we go

this patch adds:

  GtkWidget *gtk_dialog_get_vbox        (GtkDialog *dialog);
  GtkWidget *gtk_dialog_get_action_area (GtkDialog *dialog);

to the GtkDialog API. is there a way to deprecate single structure members? does gcc deprecated attribute work for them as well as for functions?
Comment 3 Matthias Clasen 2007-04-01 14:41:26 UTC
I'm not sure we gain much by adding these accessors in 2.x, and deprecating the
fields will be a disaster in terms of forcing everybody who used these fields to
turn off GTK_DISABLE_DEPRECATED. So I am not in favor of that, at least.

For the record, one way of deprecating struct fields is to conditionally rename them

#ifdef GTK_DISABLE_DEPRECATED
  GtkWidget *private_action_area;
#else
  GtkWidget *action_area;
#endif

Of course, the GTK+ code needs corresponding changes then, too.
Comment 4 Emmanuele Bassi (:ebassi) 2007-04-01 15:06:27 UTC
even without marking the struct members as deprecated we could formally make them deprecated, in this case by hiding them in the gtk-doc and adding a big warning in the class description.

the one thing we gain in 2.x would be removing the special cased code from the language bindings, even though some backward compatibility methods should be kept in place for languages missing a compile-time API/ABI compatibility.
Comment 5 Björn Lindqvist 2008-06-15 00:53:47 UTC
Seems to me that adding accessors like these as early as possible is a very good idea if there is going to be a smooth transition to 3.0, see http://mail.gnome.org/archives/gtk-devel-list/2008-June/msg00014.html. If gtk is ever going to be GSEAL:ed, then there should be accessors for interesting attributes.
Comment 6 Christian Dywan 2008-06-15 02:32:16 UTC
The GSEAL branch is in the works, to be merged with upstream soon. The changes to GtkDialog in that branch include an accessor for action_area and a GtkContainer interface so that widgets can be packed into the dialog. If you're interested, have a look at the repository provided in the mailing list thread you mentioned.
Comment 7 Björn Lindqvist 2008-10-07 19:28:28 UTC
Closing. The new functions gtk_dialog_get_action_area and gtk_dialog_get_content_area fixes the problem.