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


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

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


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

示例1: onWindowStateEvent

bool CamWnd::onWindowStateEvent(GdkEventWindowState* ev)
{
    if ((ev->changed_mask & (GDK_WINDOW_STATE_ICONIFIED|GDK_WINDOW_STATE_WITHDRAWN)) != 0)
    {
        // Now let's see what the new state of the window is
        if ((ev->new_window_state & (GDK_WINDOW_STATE_ICONIFIED|GDK_WINDOW_STATE_WITHDRAWN)) == 0)
        {
            // Window got maximised again, re-add the GL widget to fix it from going gray
            Gtk::Widget* glWidget = getWidget();

            // greebo: Unfortunate hack to fix the grey GL renderviews in Win32
            Gtk::Container* container = glWidget->get_parent();

            if (container != NULL)
            {
                glWidget->reference();
                container->remove(*glWidget);
                container->add(*glWidget);
                glWidget->unreference();
            }
        }
    }

    return false;
}
开发者ID:Zbyl,项目名称:DarkRadiant,代码行数:25,代码来源:CamWnd.cpp

示例2: 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

示例3: initialisePreview

void RenderPreview::initialisePreview()
{
#if 0
#ifdef WIN32
    // greebo: Unfortunate hack to fix the grey GL renderviews in the EntityChooser
    // and other windows that are hidden instead of destroyed when closed.
    Gtk::Container* container = get_parent();
    bool wasShown = get_visible();

    if (container != NULL)
    {
        if (wasShown)
        {
            hide();
        }

        container->remove(*this);
        container->add(*this);

        if (wasShown)
        {
            show();
        }
    }

#endif
#endif
	// Grab the GL widget with sentry object
	wxPaintDC dc(_glWidget);
	_glWidget->SetCurrent(GlobalOpenGL().getwxGLContext());
	
    // Set up the camera
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(PREVIEW_FOV, 1, 0.1, 10000);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    // Set up the lights
    glEnable(GL_LIGHTING);

    glEnable(GL_LIGHT0);
    GLfloat l0Amb[] = { 0.3f, 0.3f, 0.3f, 1.0f };
    GLfloat l0Dif[] = { 1.0f, 1.0f, 1.0f, 1.0f };
    GLfloat l0Pos[] = { 1.0f, 1.0f, 1.0f, 0.0f };
    glLightfv(GL_LIGHT0, GL_AMBIENT, l0Amb);
    glLightfv(GL_LIGHT0, GL_DIFFUSE, l0Dif);
    glLightfv(GL_LIGHT0, GL_POSITION, l0Pos);

    glEnable(GL_LIGHT1);
    GLfloat l1Dif[] = { 1.0, 1.0, 1.0, 1.0 };
    GLfloat l1Pos[] = { 0.0, 0.0, 1.0, 0.0 };
    glLightfv(GL_LIGHT1, GL_DIFFUSE, l1Dif);
    glLightfv(GL_LIGHT1, GL_POSITION, l1Pos);

    if (_renderSystem->shaderProgramsAvailable())
    {
        _renderSystem->setShaderProgram(
            RenderSystem::SHADER_PROGRAM_INTERACTION
        );
    }
}
开发者ID:nbohr1more,项目名称:DarkRadiant,代码行数:63,代码来源:RenderPreview.cpp


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