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


C++ gtk::Container类代码示例

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


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

示例1: constructGUIComponents

void CamWnd::constructGUIComponents()
{
    constructToolbar();

    // Set up GL widget
    _camGLWidget->set_events(  Gdk::EXPOSURE_MASK 
                             | Gdk::BUTTON_PRESS_MASK 
                             | Gdk::BUTTON_RELEASE_MASK 
                             | Gdk::POINTER_MOTION_MASK 
                             | Gdk::SCROLL_MASK);
    _camGLWidget->set_flags(Gtk::CAN_FOCUS);
    _camGLWidget->set_size_request(CAMWND_MINSIZE_X, CAMWND_MINSIZE_Y);
    _camGLWidget->property_can_focus() = true;

    _camGLWidget->signal_size_allocate().connect(
        sigc::mem_fun(*this, &CamWnd::onSizeAllocate)
    );
    _camGLWidget->signal_expose_event().connect(
        sigc::mem_fun(*this, &CamWnd::onExpose)
    );

    // Pack GL widget into outer widget
    Gtk::Container* glWidgetFrame = gladeWidget<Gtk::Container>(
        "glWidgetFrame"
    );
    glWidgetFrame->add(*_camGLWidget);
}
开发者ID:Zbyl,项目名称:DarkRadiant,代码行数:27,代码来源:CamWnd.cpp

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

示例3: constructDeltaChooseScale

 void MainWindow::constructDeltaChooseScale(Gtk::Container &parentContainer) {
   deltaChooseLabel.set_text("Delta:");
   parentContainer.add(deltaChooseLabel);
   deltaChooseScale.set_adjustment(Gtk::Adjustment::create(0, 0, 10, 1, 1));
   deltaChooseScale.set_digits(0);
   deltaChooseScale.set_size_request(100);
   parentContainer.add(deltaChooseScale);
 }
开发者ID:aomaesalu,项目名称:TuumBot,代码行数:8,代码来源:MainWindow.cpp

示例4: constructBrushSizeScale

 void MainWindow::constructBrushSizeScale(Gtk::Container &parentContainer) {
   brushSizeLabel.set_text("Brush size:");
   parentContainer.add(brushSizeLabel);
   brushSizeScale.set_adjustment(Gtk::Adjustment::create(30, 1, 75, 1, 5));
   brushSizeScale.set_digits(0);
   brushSizeScale.set_size_request(100);
   parentContainer.add(brushSizeScale);
 }
开发者ID:aomaesalu,项目名称:TuumBot,代码行数:8,代码来源:MainWindow.cpp

示例5: getWidget

Gtk::Window *
DockItem::getWindow()
{
    g_return_val_if_fail(_gdl_dock_item, 0);
    Gtk::Container *parent = getWidget().get_parent();
    parent = (parent ? parent->get_parent() : 0);
    return (parent ? dynamic_cast<Gtk::Window *>(parent) : 0);
}
开发者ID:GNOME,项目名称:niepce,代码行数:8,代码来源:dock-item.cpp

示例6: constructScale

 void MainWindow::constructScale(Gtk::Container &parentContainer, Gtk::Scale &scale, Gtk::Label &label, const std::string &name) {
   label.set_text(name + ":");
   parentContainer.add(label);
   scale.set_adjustment(Gtk::Adjustment::create(1.0, -10000.0, 150000.0, 10.0, 1.0));
   scale.set_digits(4);
   scale.set_size_request(100);
   scale.signal_value_changed().connect(sigc::mem_fun(*this, &MainWindow::on_scale_value_changed));
   parentContainer.add(scale);
 }
开发者ID:aomaesalu,项目名称:TuumBot,代码行数:9,代码来源:MainWindow.cpp

示例7: constructModeChooseComboBox

 void MainWindow::constructModeChooseComboBox(Gtk::Container &parentContainer) {
   modeChooseLabel.set_text("Mode:");
   parentContainer.add(modeChooseLabel);
   for (std::vector<std::string>::iterator mode = modes.begin(); mode != modes.end(); ++mode) {
     modeChooseComboBox.append(*mode);
   }
   modeChooseComboBox.signal_changed().connect(sigc::mem_fun(*this, &MainWindow::on_modeChooseComboBox_changed));
   modeChooseComboBox.set_active(0);
   parentContainer.add(modeChooseComboBox);
 }
开发者ID:aomaesalu,项目名称:TuumBot,代码行数:10,代码来源:MainWindow.cpp

示例8: activateParent

// Activate parent if necessary
void PersistentTransientWindow::activateParent()
{
	// Only activate if this window is active already
	if (gobj()->is_active)
	{
		Gtk::Container* toplevel = get_toplevel();

		if (toplevel != NULL && toplevel->is_toplevel() &&
			toplevel->is_visible() && dynamic_cast<Gtk::Window*>(toplevel) != NULL)
		{
			static_cast<Gtk::Window*>(toplevel)->present();
		}
	}
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:15,代码来源:PersistentTransientWindow.cpp

示例9: while

MainWindow *MainWindow::get_owning(Gtk::Widget & widget)
{
  Gtk::Container *container = widget.get_parent();
  if(!container) {
    return dynamic_cast<MainWindow*>(&widget);
  }

  Gtk::Container *cntr = container->get_parent();
  while(cntr) {
    container = cntr;
    cntr = container->get_parent();
  }

  return dynamic_cast<MainWindow*>(container);
}
开发者ID:mjfrancis,项目名称:GnoteOSX,代码行数:15,代码来源:mainwindow.cpp

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

示例11: PackTrackWindow

void PackTrackWindow(Gtk::Container& contr, TWFunctor tw_fnr)
{
    Gtk::VPaned& vpaned = *Gtk::manage(new Gtk::VPaned);
    contr.add(vpaned);

    Timeline::DAMonitor& mon = *Gtk::manage(new Timeline::DAMonitor);

#ifdef VOB_MVIEWER_INTRUSION
    {
        Mpeg::Player& plyr = mon.GetPlayer();
        Bunch& bunch = Bunch::Instance();

        //const char* dvd_path = "/mnt/ntfs/DVD_Demystified";
        const char* dvd_path = "/media/cdrom";

        bunch.dvd = DVDOpen(dvd_path);
        bunch.wrp = new DtorAction(bl::bind(&DVDClose, bunch.dvd));

        DVD::FillVobArr(bunch.dvd_vobs, bunch.dvd);
        DVD::VobPtr vob = DVD::FindVob(bunch.dvd_vobs, 1, 1); //34, 1); 
        ptr::shared<DVD::VobStreambuf> strm_buf = new DVD::VobStreambuf(vob, bunch.dvd);

        io::cout << "Vob size = " << strm_buf->Size() << io::endl;
        
        plyr.OpenFBuf(strm_buf);
    }
#endif // VOB_MVIEWER_INTRUSION

    TrackLayout& layout = *Gtk::manage(new TrackLayout(mon));
    {
        Gtk::VBox& vbox = *Gtk::manage(new Gtk::VBox);
        vpaned.add1(vbox);

        Gtk::HPaned& hpaned = *Gtk::manage(new Gtk::HPaned);
        SetUpdatePos(hpaned, UnnamedPrefs().srcBrw1Wdh);
        vbox.pack_start(hpaned, true, true, 0);

        tw_fnr(hpaned, mon, layout);

        Gtk::HSeparator& hsep = *Gtk::manage(new Gtk::HSeparator);
        vbox.pack_end(hsep, false, true, 0);
    }

    // 2 шкала
    PackTrackLayout(vpaned, layout);

    // 3 приведение к гармоничной форме
    gtk_container_child_set(vpaned.Gtk::Container::gobj(), 
                            vpaned.get_child1()->gobj(), "resize", TRUE,  NULL);
    gtk_container_child_set(vpaned.Gtk::Container::gobj(), 
                            vpaned.get_child2()->gobj(), "resize", FALSE, NULL);

    vpaned.signal_realize().connect(bb::bind(&SetGarmonicHeightForTrk, boost::ref(vpaned)));
}
开发者ID:cargabsj175,项目名称:bombono-dvd,代码行数:54,代码来源:mviewer.cpp

示例12: add

ExampleWindow::ExampleWindow()
: m_VBox(Gtk::ORIENTATION_VERTICAL, 6),
  m_Button_Quit(Gtk::Stock::QUIT),
  m_Button_Clear("Clear")
{
  set_title("Gtk::InfoBar example");
  set_border_width(6);
  set_default_size(400, 200);

  add(m_VBox);

  // Add the message label to the InfoBar:
  Gtk::Container* infoBarContainer =
    dynamic_cast<Gtk::Container*>(m_InfoBar.get_content_area());
  if (infoBarContainer)
    infoBarContainer->add(m_Message_Label);

  // Add an ok button to the InfoBar:
  m_InfoBar.add_button(Gtk::Stock::OK, 0);

  // Add the InfoBar to the vbox:
  m_VBox.pack_start(m_InfoBar, Gtk::PACK_SHRINK);

  // Create the buffer and set it for the TextView:
  m_refTextBuffer = Gtk::TextBuffer::create();
  m_TextView.set_buffer(m_refTextBuffer);

  // Add the TreeView, inside a ScrolledWindow:
  m_ScrolledWindow.add(m_TextView);

  // Show the scrollbars only when they are necessary:
  m_ScrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);

  m_VBox.pack_start(m_ScrolledWindow);

  // Add button box:
  m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);

  m_ButtonBox.pack_start(m_Button_Clear, Gtk::PACK_SHRINK);
  m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
  m_ButtonBox.set_spacing(6);
  m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);

  // Connect signals:
  m_InfoBar.signal_response().connect(sigc::mem_fun(*this,
              &ExampleWindow::on_infobar_response) );
  m_Button_Quit.signal_clicked().connect(sigc::mem_fun(*this,
              &ExampleWindow::on_button_quit) );
  m_Button_Clear.signal_clicked().connect(sigc::mem_fun(*this,
              &ExampleWindow::on_button_clear) );
  m_refTextBuffer->signal_changed().connect(sigc::mem_fun(*this,
              &ExampleWindow::on_textbuffer_changed) );

  show_all_children();

  // Keep the InfoBar hidden until a message needs to be shown:
  m_InfoBar.hide();

  // Make the clear button insensitive until text is typed in the buffer.  When
  // the button is sensitive and it is pressed, the InfoBar is displayed with a
  // message.
  m_Button_Clear.set_sensitive(false);
}
开发者ID:hamedobaidy,项目名称:gtkmm_eclipse_examples,代码行数:63,代码来源:examplewindow.cpp

示例13: constructPlayButton

 void MainWindow::constructPlayButton(Gtk::Container &parentContainer) {
   playButton.set_label("Play");
   playButton.signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::on_playButton_clicked));
   playButton.set_sensitive(false);
   parentContainer.add(playButton);
 }
开发者ID:aomaesalu,项目名称:TuumBot,代码行数:6,代码来源:MainWindow.cpp

示例14: constructOpenButton

 void MainWindow::constructOpenButton(Gtk::Container &parentContainer) {
   openButton.set_label("Open");
   openButton.signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::on_openButton_clicked));
   parentContainer.add(openButton);
 }
开发者ID:aomaesalu,项目名称:TuumBot,代码行数:5,代码来源:MainWindow.cpp

示例15: constructSaveButton

 void MainWindow::constructSaveButton(Gtk::Container &parentContainer) {
   saveButton.set_label("Save");
   saveButton.signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::on_saveButton_clicked) );
   parentContainer.add(saveButton);
 }
开发者ID:aomaesalu,项目名称:TuumBot,代码行数:5,代码来源:MainWindow.cpp


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