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 108484 - lowl-level GDK methods for Widget from scratch
lowl-level GDK methods for Widget from scratch
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.4
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-03-15 20:30 UTC by Detlef Reichl
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
enable building gtkmm Widgets from scratch (423 bytes, patch)
2003-03-15 20:32 UTC, Detlef Reichl
none Details | Review

Description Detlef Reichl 2003-03-15 20:30:22 UTC
to build Widgets from scratch the two protected functions
set_window (to set the Gdk::Window of a new created widget) and set
allocation (to set size and position) are needed.

Patch to correct this is attachted
Comment 1 Detlef Reichl 2003-03-15 20:32:59 UTC
Created attachment 15047 [details] [review]
enable building gtkmm Widgets from scratch
Comment 2 Murray Cumming 2003-03-16 08:44:22 UTC
"protected"? So these already exist somewhere? So why would we add?

Could you give me an example of how these are used to implement GTK+
widgets, by giving me a line number in a GTK+ source file, or a URL?

Do you some way to deref/deallocate the existing allocationa and
GdkWindow?
Comment 3 Murray Cumming 2003-03-16 08:45:21 UTC
Oh, I guess you mean that they should be added as protected.
Comment 4 Detlef Reichl 2003-03-16 11:06:35 UTC
yes, that's what i ment, they shall be protected, caus you only need
them in subclasses of Gtk::Widget.

the simples example is (i think) the gtkruler.


here you set in

  gtk_ruler_realize (GtkWidget *widget)

with

  widget->window = gdk_window_new (gtk_widget_get_parent_window
(widget), &attributes, attributes_mask);

the new created GdkWindow to GtkWidget->window. Caus per default
Widget->window == NULL you don't have to unref an old window.


in

  gtk_ruler_size_allocate (GtkWidget     *widget,
             GtkAllocation *allocation)

you set the widgets allocation to the parameter *allocation

  widget->allocation = *allocation;


i _think_ we don't have to deref here something, caus the poniter
points to a GtkAllocation, that is created and destroyed with the
instances of the subclasses of the widget. In the Gtk+ sources this
Allocation is never freed.
Comment 5 Murray Cumming 2003-03-18 15:49:04 UTC
GdkWindow: OK. _MEMBER_SET_GOBJECT() seems to take care of ref-ing and
unrefing for us, so I didn't need to worry.

Allocation: Yes, this seems to be a simple copy-by-value struct.

This should be applied to gtkmm 2.4, with a ChangeLog entry.
Comment 6 Ole Laursen 2003-03-20 21:12:47 UTC
Applied. Detlef, if you could patch the ChangeLog too next time, it
would make the process a little less tedious for random persons like
me who are applying patches on behalf of Murray. :-)
Comment 7 Murray Cumming 2003-03-21 10:14:01 UTC
Thanks Ole.