本文整理汇总了C++中GLUI::get_glut_window_id方法的典型用法代码示例。如果您正苦于以下问题:C++ GLUI::get_glut_window_id方法的具体用法?C++ GLUI::get_glut_window_id怎么用?C++ GLUI::get_glut_window_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLUI
的用法示例。
在下文中一共展示了GLUI::get_glut_window_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
GLUI *edit = GLUI_Master.create_glui("Help on GLUI Widgets", 0);
main_window = edit->get_glut_window_id();
GLUI_Panel *ep = new GLUI_Panel(edit,"",true);
new GLUI_StaticText(ep,"Widget Information:");
hah = new GLUI_List(ep,true,1,control_cb);
hah->add_item(0,"GLUI 2.3");
hah->add_item(1,"TextBox");
hah->add_item(2,"Scrollbar");
hah->add_item(3,"GLUI_String");
hah->add_item(4,"CommandLine");
hah->add_item(5,"Tree");
hah->add_item(6,"List");
hah->add_item(7,"FileBrowser");
new GLUI_StaticText(ep,"Open Text File:");
fb = new GLUI_FileBrowser(ep, "", false, 7, control_cb);
fb->set_h(180);
hah->set_h(180);
new GLUI_Column(ep,false);
moo = new GLUI_TextBox(ep,true,1,textbox_cb);
moo->set_text(general);
moo->set_h(400);
moo->set_w(410);
moo->disable();
enable_textbox=0;
new GLUI_Checkbox(ep, "Enable text box:",&enable_textbox,12,control_cb);
tree = GLUI_Master.create_glui("Tree Test", 0);
ep = new GLUI_Panel(tree, "Tree Controls");
bedit = new GLUI_EditText(ep, "New Branch Name:");
new GLUI_Checkbox(ep, "Display Numbers", &num_display);
new GLUI_StaticText(ep, "Number format:");
GLUI_RadioGroup *rg = new GLUI_RadioGroup(ep, &num_format);
new GLUI_RadioButton(rg, "Level Only");
new GLUI_RadioButton(rg, "Hierarchal");
new GLUI_Button(ep, "Update Format", 11, control_cb);
new GLUI_Column(ep);
new GLUI_Button(ep, "Add Branch", 2, control_cb);
new GLUI_Button(ep, "Del Branch", 3, control_cb);
new GLUI_Button(ep, "Up Branch", 4, control_cb);
new GLUI_Button(ep, "Goto Root", 5, control_cb);
new GLUI_Column(ep);
new GLUI_Button(ep, "Descend to Leaf", 6, control_cb);
new GLUI_Button(ep, "Next Branch", 8, control_cb);
new GLUI_Button(ep, "Expand All", 9, control_cb);
new GLUI_Button(ep, "Collapse All", 10, control_cb);
tp = new GLUI_TreePanel(tree,"Tree Test");
tp->set_format(GLUI_TREEPANEL_ALTERNATE_COLOR |
GLUI_TREEPANEL_CONNECT_CHILDREN_ONLY |
GLUI_TREEPANEL_DISPLAY_HIERARCHY |
GLUI_TREEPANEL_HIERARCHY_NUMERICDOT);
tp->set_level_color(1,1,1);
tp->ab("foo you");
tree->hide();
edit->set_main_gfx_window(main_window);
tree->set_main_gfx_window(main_window);
glutMainLoop();
return 0;
}