示例#1
0
GtkFileBrowser*
gtk_file_browser_new (void)
{
	GtkFileBrowser *file_browser;

	file_browser = gtk_type_new (gtk_file_browser_get_type());

	/*
		Type:Name:Size:Flags:Attr:Access,Modify,Change,Links,Uid,Gid,INode,Device
	*/

	gtk_clist_construct (GTK_CLIST(file_browser),13,titles);
	gtk_clist_set_selection_mode (GTK_CLIST(file_browser),GTK_SELECTION_EXTENDED);

	gtk_clist_set_column_justification (GTK_CLIST(file_browser),2,GTK_JUSTIFY_RIGHT);
 
	gtk_clist_set_column_width (GTK_CLIST(file_browser),0,30); // type
	gtk_clist_set_column_width (GTK_CLIST(file_browser),1,200);
	gtk_clist_set_column_width (GTK_CLIST(file_browser),2,70);
	gtk_clist_set_column_width (GTK_CLIST(file_browser),3,120);
	gtk_clist_set_column_width (GTK_CLIST(file_browser),4,120);
	gtk_clist_set_column_width (GTK_CLIST(file_browser),5,4);
	gtk_clist_set_column_width (GTK_CLIST(file_browser),6,4);
	gtk_clist_set_column_width (GTK_CLIST(file_browser),7,4);
	gtk_clist_set_column_width (GTK_CLIST(file_browser),8,4);
	gtk_clist_set_column_width (GTK_CLIST(file_browser),9,90);
	gtk_clist_set_column_width (GTK_CLIST(file_browser),10,90);

	file_browser->use_icons = TRUE;

	gtk_signal_connect (GTK_OBJECT(GTK_CLIST(file_browser)), "select_row",
		GTK_SIGNAL_FUNC (on_select_row), NULL);

	return GTK_FILE_BROWSER(file_browser);
}
示例#2
0
static GtkWidget *
tclist_new (int cols)
{ GtkWidget *widget;

  widget = gtk_type_new (tclist_get_type ());
  gtk_clist_construct (GTK_CLIST (widget), cols, NULL);
  return widget;
}