Lines Matching defs:widget

6 // ownership between a C++ object and a GTK widget.  It is common to have a
7 // C++ object which encapsulates a GtkWidget, and that widget is exposed from
18 // GtkWidget* widget() { return vbox_.get() }; // Host my widget!
23 // This design will ensure that the widget stays alive from the call to Own()
33 // container owns the widget, and if we remove the widget from the container,
34 // the widget is destroyed. This style of ownership often causes problems when
35 // you have an object encapsulating the widget. If we just use a raw
36 // GtkObject* with no specific ownership management, we push the widget's
38 // the widget being valid, since it doesn't manage its lifetime. If the widget
41 // solution is fairly simple, make sure that the C++ object owns the widget,
43 // GtkWidget* widget = gtk_widget_new();
44 // g_object_ref_sink(widget); // Claim the initial floating reference.
46 // gtk_destroy_widget(widget); // Ask all code to destroy their references.
47 // g_object_unref(widget); // Destroy the initial reference we had claimed.
62 // Create an instance that owns |widget|.
63 explicit OwnedWidgetGtk(GtkWidget* widget) : widget_(NULL) { Own(widget); }
67 // Return the currently owned widget, or NULL if no widget is owned.
71 // Takes ownership of a widget, by taking the initial floating reference of
72 // the GtkWidget. It is expected that Own() is called right after the widget
73 // has been created, and before any other references to the widget might have
76 void Own(GtkWidget* widget);
79 // will call gtk_widget_destroy(), and drop our reference to the widget.