diff options
author | Maciej Stachowiak <mstachow@src.gnome.org> | 2000-02-20 01:29:39 +0000 |
---|---|---|
committer | Maciej Stachowiak <mstachow@src.gnome.org> | 2000-02-20 01:29:39 +0000 |
commit | 53c5e06a43be25f5a72126a040ee3841cd764cd5 (patch) | |
tree | e865b2c7d9f06ddbc638f6ddbf29164d024cfdf5 /components/websearch | |
parent | 223a3193c9294a1a4826e9e329f1ee992859a3e5 (diff) | |
download | nautilus-53c5e06a43be25f5a72126a040ee3841cd764cd5.tar.gz |
Changed NautilusViewFrame to allow creation of `Nautilus::View' objects
* libnautilus/ntl-view-frame.c, libnautilus/ntl-view-frame.h:
Changed NautilusViewFrame to allow creation of `Nautilus::View'
objects that have additional interfaces while sharing the actual
control. This will allow, for instance, the creation of components
that are both a `Nautilus::View' and a `Bonobo::Embeddable'. The
basic changes are to require a `BonoboObject' with a
`Bonobo::Control' interface at construction time.
- Two creation functions are provided: `nautilus_view_frame_new',
which takes a GtkWidget, creates a new control that contains that
widget, and the constructs a NautilusViewFrame with that control,
and `nautilus_view_frame_new_from_control', which creates a
NautilusViewFrame that gets added as an additional interface to an
existing control.
- In the course of doing this it became clear that it would be
easier if NautilusViewFrame were changed to inherit from
BonoboObject rather than GtkBin, so this was done; as a result,
the nautilus_view_frame_get_bonobo_object call was removed, since
the view_frame _is_ a bonobo object. However, a
nautilus_view_frame_get_bonobo_control call was added as a
convenience, to allow other code to avoid having to
query_local_interface for the control object manually.
* libnautilus/ntl-meta-view-frame.c,
libnautilus/ntl-meta-view-frame.h,
libnautilus/ntl-content-view-frame.c,
libnautilus/ntl-content-view-frame.h: Analogous changes; mainly,
added `nautilus_meta_view_frame_new',
`nautilus_meta_view_frame_new_from_control',
`nautilus_content_view_frame_new' and
`nautilus_content_view_frame_new_from_control'.
* components/help/hyperbola-nav-index.c,
components/help/hyperbola-nav-tree.c,
components/history/ntl-history-view.c,
components/html/ntl-web-browser.c, components/notes/ntl-notes.c,
components/websearch/ntl-web-search.c, src/ntl-app.c,
src/file-manager/fm-directory-view.c: Fixed initialization and
object creation functions to deal with the above API change.
Diffstat (limited to 'components/websearch')
-rw-r--r-- | components/websearch/ntl-web-search.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/components/websearch/ntl-web-search.c b/components/websearch/ntl-web-search.c index 45b6b8de9..7117168ee 100644 --- a/components/websearch/ntl-web-search.c +++ b/components/websearch/ntl-web-search.c @@ -165,23 +165,17 @@ web_search_populate_engines(WebSearchView *hview) static BonoboObject * make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure) { - GtkWidget *frame, *vbox; - BonoboObject *ctl; + GtkWidget *vbox; WebSearchView *hview; g_return_val_if_fail(!strcmp(goad_id, "ntl_websearch_view"), NULL); hview = g_new0(WebSearchView, 1); - frame = gtk_widget_new(nautilus_meta_view_frame_get_type(), NULL); - gtk_signal_connect(GTK_OBJECT(frame), "destroy", do_destroy, NULL); - object_count++; - ctl = nautilus_view_frame_get_bonobo_object(NAUTILUS_VIEW_FRAME(frame)); vbox = gtk_vbox_new(FALSE, GNOME_PAD); - gtk_container_add(GTK_CONTAINER(frame), vbox); - hview->btn_search = gnome_pixmap_button(gnome_stock_pixmap_widget(frame, GNOME_STOCK_PIXMAP_SEARCH), _("Search")); + hview->btn_search = gnome_pixmap_button(gnome_stock_pixmap_widget (vbox, GNOME_STOCK_PIXMAP_SEARCH), _("Search")); gtk_signal_connect(GTK_OBJECT(hview->btn_search), "clicked", do_search, hview); gtk_box_pack_start(GTK_BOX(vbox), hview->btn_search, FALSE, FALSE, GNOME_PAD); @@ -213,19 +207,26 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure) gtk_signal_connect(GTK_OBJECT(clist), "select_row", web_search_select_row, hview); #endif - gtk_widget_show_all(frame); + gtk_widget_show_all(vbox); + + hview->clist = NULL; + + /* create CORBA object */ + + hview->view = NAUTILUS_VIEW_FRAME (nautilus_meta_view_frame_new (vbox)); + gtk_signal_connect(GTK_OBJECT (hview->view), "destroy", do_destroy, NULL); + object_count++; + /* handle events */ - gtk_signal_connect(GTK_OBJECT(frame), "notify_location_change", web_search_notify_location_change, hview); + gtk_signal_connect(GTK_OBJECT(hview->view), "notify_location_change", web_search_notify_location_change, hview); /* set description */ - nautilus_meta_view_frame_set_label(NAUTILUS_META_VIEW_FRAME(frame), - _("WebSearch")); + nautilus_meta_view_frame_set_label (NAUTILUS_META_VIEW_FRAME (hview->view), + _("WebSearch")); - hview->view = (NautilusViewFrame *)frame; - hview->clist = NULL; - return ctl; + return BONOBO_OBJECT (hview->view); } int main(int argc, char *argv[]) |