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


C++ Container::show_all方法代码示例

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


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

示例1: init

void VRGuiVectorEntry::init(string placeholder, string label,  sigc::slot<void, OSG::Vec3f&> sig) {
    Gtk::Fixed* ph;
    VRGuiBuilder()->get_widget(placeholder.c_str(), ph);
    Gtk::Container* frame = ph->get_parent();
    frame->remove(*ph);

    Gtk::HBox* hb = new Gtk::HBox();
    frame->add(*hb);

    Gtk::Label* lbl = new Gtk::Label();
    lbl->set_text(label.c_str());
    lbl->set_size_request(50, -1);

    ex = new Gtk::Entry();
    ey = new Gtk::Entry();
    ez = new Gtk::Entry();
    ex->set_has_frame(false);
    ey->set_has_frame(false);
    ez->set_has_frame(false);
    ex->set_size_request(50, -1);
    ey->set_size_request(50, -1);
    ez->set_size_request(50, -1);

    Gtk::VSeparator *s1, *s2, *s3;
    s1 = new Gtk::VSeparator();
    s2 = new Gtk::VSeparator();
    s3 = new Gtk::VSeparator();

    hb->pack_start(*lbl, false, false, 2);
    hb->pack_start(*s1, false, false, 0);
    hb->pack_start(*ex, false, false, 0);
    hb->pack_start(*s2, false, false, 0);
    hb->pack_start(*ey, false, false, 0);
    hb->pack_start(*s3, false, false, 0);
    hb->pack_start(*ez, false, false, 0);
    frame->show_all();

    sigc::slot<bool,GdkEventFocus*> sif = sigc::bind(&VRGuiVectorEntry::proxy, sig, ex, ey, ez);
    ex->signal_focus_out_event().connect( sif );
    ey->signal_focus_out_event().connect( sif );
    ez->signal_focus_out_event().connect( sif );

    sigc::slot<bool> sia_b = sigc::bind<GdkEventFocus*>(&VRGuiVectorEntry::proxy, 0, sig, ex, ey, ez);
    sigc::slot<void> sia = sigc::hide_return( sia_b );
    ex->signal_activate().connect(sia);
    ey->signal_activate().connect(sia);
    ez->signal_activate().connect(sia);
}
开发者ID:Pfeil,项目名称:polyvr,代码行数:48,代码来源:VRGuiVectorEntry.cpp

示例2: constructLayout

void SplitPaneLayout::constructLayout()
{
	_splitPane = SplitPaneView();

	_cameraPosition = getCameraPositionFromRegistry();

	const Glib::RefPtr<Gtk::Window>& parent = GlobalMainFrame().getTopLevelWindow();

	// Create a new camera window and parent it
	_camWnd = GlobalCamera().createCamWnd();
	 // greebo: The mainframe window acts as parent for the camwindow
	_camWnd->setContainer(parent);

	_camera = Gtk::manage(new gtkutil::FramedWidget(*_camWnd->getWidget()));

	// Allocate paned widgets
	_splitPane.horizPane.reset(new Gtk::HPaned);
	_splitPane.vertPane1 = Gtk::manage(new Gtk::VPaned);
	_splitPane.vertPane2 = Gtk::manage(new Gtk::VPaned);

	// Arrange the widgets into the paned views
	_splitPane.horizPane->pack1(*_splitPane.vertPane1, true, true);
	_splitPane.horizPane->pack2(*_splitPane.vertPane2, true, true);

	// Retrieve the main container of the main window
	Gtk::Container* mainContainer = GlobalMainFrame().getMainContainer();
	mainContainer->add(*_splitPane.horizPane);

	_splitPane.horizPane->set_position(200);
	_splitPane.vertPane1->set_position(200);
	_splitPane.vertPane2->set_position(400);

	_splitPane.posHPane.connect(_splitPane.horizPane.get());
	_splitPane.posVPane1.connect(_splitPane.vertPane1);
	_splitPane.posVPane2.connect(_splitPane.vertPane2);

	// Attempt to restore this layout's state, this will also construct the orthoviews
	restoreStateFromPath(RKEY_SPLITPANE_ROOT);

	// Distribute widgets among quadrants
	distributeWidgets();

    {
		Gtk::Frame* textureBrowser = Gtk::manage(new gtkutil::FramedWidget(
			*GlobalTextureBrowser().constructWindow(parent)
		));

		// Add the Media Browser page
		GlobalGroupDialog().addPage(
	    	"textures",	// name
	    	"Textures", // tab title
	    	"icon_texture.png", // tab icon
	    	*textureBrowser, // page widget
	    	_("Texture Browser")
	    );
    }

	GlobalGroupDialog().showDialogWindow();

	// greebo: Now that the dialog is shown, tell the Entity Inspector to reload
	// the position info from the Registry once again.
	GlobalEntityInspector().restoreSettings();

	GlobalGroupDialog().hideDialogWindow();

	mainContainer->show_all();
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:67,代码来源:SplitPaneLayout.cpp


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