当前位置: 首页>>代码示例>>C++>>正文


C++ TreeView::show方法代码示例

本文整理汇总了C++中gtk::TreeView::show方法的典型用法代码示例。如果您正苦于以下问题:C++ TreeView::show方法的具体用法?C++ TreeView::show怎么用?C++ TreeView::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gtk::TreeView的用法示例。



在下文中一共展示了TreeView::show方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: getThreadData

void getThreadData(Glib::RefPtr<Gtk::ListStore> m_threads_tree_model) {
	///Get the thread data as JSON, and then push it onto the ListStore given in m_threads_tree_model
	
	Gtk::Spinner *spin = 0;
	builder->get_widget("spinner1", spin);
	spin->set_visible(true);
	spin->show();
	
	Gtk::TreeView *tree = 0;
	builder->get_widget("treeview2", tree);
	tree->hide();
	tree->set_visible(false);
	Json::Value json = getThreads(BOARD);
	
	for(int j=0;j<json.size();++j) {
		Json::Value threads = json[j]["threads"];
		for(int i=0;i<threads.size();++i) {
			Gtk::TreeModel::Row row = *(m_threads_tree_model->append());
			
			ostringstream convert3;
			convert3 << threads[i]["replies"].asUInt();
			
			row[m_thread_list.text] = standardPostFormatting(threads[i])+"\n\n"+convert3.str()+" replies";
			row[m_thread_list.tim] = threads[i]["tim"].asString();
			row[m_thread_list.ext] = trim(threads[i]["ext"].asString());
			if(threads[i].isMember("filename")) {
				row[m_thread_list.fn] = threads[i]["filename"].asString();
			}
			
			ostringstream convert2;
			convert2 << threads[i]["no"].asInt();
			row[m_thread_list.no] = convert2.str();
		}
	}
	
	spin->hide();
	spin->set_visible(false);
	
	tree->show();
	tree->set_visible(true);
}
开发者ID:Klendathu,项目名称:minichan,代码行数:41,代码来源:main.cpp


示例2: on_refresh_posts_clicked

void on_refresh_posts_clicked(Glib::RefPtr<Gtk::ListStore> m_threads_tree_model) {
	///To be executed when the refresh button is clicked while viewing a thread
	
	Gtk::Spinner *spin = 0;
	builder->get_widget("spinner1", spin);
	spin->show();
	spin->set_visible(true);
	
	Gtk::TreeView *tree = 0;
	builder->get_widget("treeview4", tree);
	tree->hide();
	tree->set_visible(false);
	
	m_threads_tree_model->clear();
	getPostData(m_threads_tree_model);
	webkit_web_view_load_uri(pWebKitView, "about:blank");
	
	spin->hide();
	spin->set_visible(false);
	
	tree->show();
	tree->set_visible(true);
}
开发者ID:Klendathu,项目名称:minichan,代码行数:23,代码来源:main.cpp


示例3: on_thread_activated

void on_thread_activated(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* column, Glib::RefPtr<Gtk::TreeModel> model, Glib::RefPtr<Gtk::ListStore> store) {
	///To be run when a thread is double clicked
	
	Gtk::TreeModel::iterator iter = model->get_iter(path);
	Gtk::TreeModel::Row row = *iter;
	string no = row[m_thread_list.no];
	
	THREAD = no;
	
	cout << THREAD << endl;
	cout << BOARD << endl;
	
	threadView();
	
	Gtk::TreeView *postlist = 0;
	builder->get_widget("treeview4", postlist);
	postlist->set_visible(true);
	postlist->show();
	
	Gtk::ScrolledWindow *imgview = 0;
	builder->get_widget("scrolledwindow3", imgview);
	
	gtk_container_add (GTK_CONTAINER (imgview->gobj()), GTK_WIDGET (pWebKitView));
	webkit_web_view_load_uri(pWebKitView, "about:blank");
	webkit_web_view_set_zoom_level(pWebKitView, true);
	gtk_widget_set_can_focus(GTK_WIDGET(pWebKitView), true);
	gtk_widget_show(GTK_WIDGET(pWebKitView));
	
	Glib::RefPtr<Gtk::ListStore> m_posts_tree_model;
	m_posts_tree_model = Gtk::ListStore::create(m_post_list);
	m_posts_tree_model->clear();
	postlist->set_model(m_posts_tree_model);
	postlist->set_search_column(1);
	postlist->get_column(1)->set_visible(false);
	postlist->get_column(2)->set_visible(false);
	postlist->get_column(3)->set_visible(false);
	postlist->get_column(4)->set_visible(false);
	postlist->get_column(5)->set_visible(false);
	
	postlist->signal_key_press_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_thread), m_posts_tree_model));
	postlist->signal_key_release_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_thread), m_posts_tree_model));
	postlist->add_events(Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK);
	
	Gtk::CellRendererText* cellRender = dynamic_cast<Gtk::CellRendererText*>(postlist->get_column_cell_renderer(0));
	cellRender->property_wrap_mode() = Pango::WRAP_WORD;
	cellRender->property_wrap_width() = 400;
	cellRender->set_alignment(0, 0);
	
	Glib::RefPtr<Gtk::TreeSelection> thread_selection = postlist->get_selection();
	thread_selection->signal_changed().connect(sigc::bind<Glib::RefPtr<Gtk::TreeSelection>, WebKitWebView*>(sigc::ptr_fun(&on_selection_changed_post), thread_selection, pWebKitView));
	
	getPostData(m_posts_tree_model);
	
	postlist->grab_focus();
	
	Gtk::ToolButton* refresh;
	builder->get_widget("toolbutton6", refresh);
	refresh->set_visible(true);
	refresh->show();
	POST_REFRESH_CONNECT = refresh->signal_clicked().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_refresh_posts_clicked), m_posts_tree_model));
	
	Gtk::ScrolledWindow *postwin = 0;
	builder->get_widget("scrolledwindow4", postwin);
	postwin->set_visible(true);
	postwin->show();
	
	POST_CLICK_CONNECT = postlist->signal_row_activated().connect(sigc::bind<Glib::RefPtr<Gtk::TreeModel>, Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_post_activated1), postlist->get_model(), m_posts_tree_model));
}
开发者ID:Klendathu,项目名称:minichan,代码行数:68,代码来源:main.cpp


示例4: show_pad_properties

void GstPropertiesModule::show_pad_properties()
{
	auto pad = std::dynamic_pointer_cast<PadModel>(controller->get_selected_object());

	if (!pad)
	{
		return;
	}

	PadPropertyModelColumns cols;
	auto model = Gtk::TreeStore::create(cols);
	Gtk::TreeView *tree = Gtk::manage(new Gtk::TreeView());
	tree->append_column(_("Property Name"), cols.m_col_name);
	tree->append_column(_("Property Value"), cols.m_col_value);
	tree->set_model(model);

#define APPEND_ROW(name, value) \
	do { \
		row = *(model->append()); \
		row[cols.m_col_name] = name; \
		row[cols.m_col_value] = value; \
	} while (false);

	std::string peer_pad = pad->get_peer() ? ElementPathProcessor::get_object_path(pad->get_peer()) : std::string("NO PEER PAD");

	Gtk::TreeModel::Row row;
	APPEND_ROW(_("Name"), pad->get_name());

	if (pad->get_template())
	{
		display_template_info(pad->get_template(), model, cols.m_col_name, cols.m_col_value);
	}

	APPEND_ROW(_("Presence"), get_presence_str(pad->get_presence()));
	APPEND_ROW(_("Direction"), get_direction_str(pad->get_direction()));
	APPEND_ROW(_("Peer pad"), peer_pad);

	if (pad->get_current_caps())
	{
		APPEND_ROW(_("Current caps"), "");
		display_caps(pad->get_current_caps(), model, cols.m_col_name, cols.m_col_value, row);
	}
	else
	{
		APPEND_ROW(_("Current caps"), _("unknown"));
	}

	if (pad->get_allowed_caps())
	{
		APPEND_ROW(_("Allowed caps"), "");
		display_caps(pad->get_allowed_caps(), model, cols.m_col_name, cols.m_col_value, row);
	}
	else
	{
		APPEND_ROW(_("Allowed caps"), _("unknown"));
	}

#undef APPEND_ROW

	tree->show();
	properties_box->pack_start(*tree, true, true, 0);
}
开发者ID:GNOME,项目名称:gst-debugger,代码行数:62,代码来源:gst_properties_module.cpp



注:本文中的gtk::TreeView::show方法示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。