Easier Property Setting

There is an easier way to set the initial properties on a GNOME File Selector. This is done by utilizing the item container moniker, by appending a ! and then name=value pairs of properties.

Example 8. Advanced GNOME File Selector Creation


	  GtkWidget *control;
	  char      *moniker;

	  moniker = g_strdup_printf (
	          "OAFIID:GNOME_FileSelector!"
	          "AcceptDirectories=False;"
	          "Application=MyApp;"
	          "DefaultFileName=%s;"
	          "MimeTypes=%s:text/plain;"
	          "MultipleSelection=True",
	          get_last_file_name (),
	          _("Text Files"));
	  
	  control = bonobo_widget_new_control (moniker, CORBA_OBJECT_NIL);
	  gtk_widget_show (control);
	  g_free (moniker);
	

This lets you bypass the querying for a PropertyBag and various set property calls.

Note

Make sure to put a semicolon after each name=value pair!