Example #1
0
Gtk::Window * Inkscape::UI::window_new (const gchar *title, unsigned int resizeable)
{
    Gtk::Window *window = new Gtk::Window(Gtk::WINDOW_TOPLEVEL);
    window->set_title (title);
    window->set_resizable (resizeable);
    window->signal_key_press_event().connect(sigc::ptr_fun(&on_window_key_press));

    return window;
}
Example #2
0
VRGuiBits::VRGuiBits() {
    setComboboxCallback("combobox4", VRGuiBits_on_camera_changed);
    setComboboxCallback("combobox9", VRGuiBits_on_navigation_changed);

    setToolButtonCallback("toolbutton4", VRGuiBits_on_save_clicked);
    setToolButtonCallback("toolbutton3", VRGuiBits_on_quit_clicked);
    setToolButtonCallback("toolbutton17", VRGuiBits_on_about_clicked);
    setToolButtonCallback("toolbutton18", VRGuiBits_on_internal_clicked);

    setButtonCallback("button14", VRGuiBits_on_new_cancel_clicked);
    setButtonCallback("button21", VRGuiBits_on_internal_close_clicked);

    setLabel("label24", "Project: None");

    // About Dialog

    Gtk::AboutDialog* diag;
    VRGuiBuilder()->get_widget("aboutdialog1", diag);
    diag->signal_response().connect( sigc::mem_fun(*this, &VRGuiBits::hideAbout) );
    ifstream f("ressources/gui/authors");
    vector<string> authors;
    for (string line; getline(f, line); ) authors.push_back(line);
    f.close();
    diag->set_authors(authors);

    // window fullscreen
    Gtk::Window* win;
    VRGuiBuilder()->get_widget("window1", win);
    win->signal_key_press_event().connect( sigc::mem_fun(*this, &VRGuiBits::toggleFullscreen) );

    // VTE

    GtkWidget* vte = vte_terminal_new();
    terminal = VTE_TERMINAL (vte);

    vte_terminal_set_background_transparent(terminal, FALSE);
    vte_terminal_set_scrollback_lines(terminal, -1);
    vte_terminal_set_size(terminal, 80, 20);

    char** argv=NULL;
    g_shell_parse_argv("/bin/bash", NULL, &argv, NULL);
    vte_terminal_fork_command_full(terminal, VTE_PTY_DEFAULT, NULL, argv, NULL, GSpawnFlags(0), NULL, NULL, NULL, NULL);

    vte_terminal_set_scroll_on_keystroke(terminal, TRUE);
    gtk_widget_set_size_request(vte, -1, 100);

    GtkWidget* scrollbar = gtk_vscrollbar_new(vte_terminal_get_adjustment(terminal));
    term_box = gtk_hbox_new(FALSE, 0);
    gtk_box_pack_start(GTK_BOX(term_box), vte, FALSE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(term_box), scrollbar, FALSE, FALSE, 0);

    Gtk::VPaned* paned;
    VRGuiBuilder()->get_widget("vpaned1", paned);
    gtk_paned_pack2(GTK_PANED (paned->gobj()), term_box, FALSE, FALSE);

    vte_terminal_get_emulation(VTE_TERMINAL (vte));

    gtk_widget_show (term_box);
    gtk_widget_show (vte);

    //int pos = paned->property_max_position () - 100;
    //paned->set_position(pos);

    VRFunction<int>* fkt = new VRFunction<int>( "IntMonitor_guiUpdate", VRGuiBits_on_internal_update );
    VRSceneManager::get()->addUpdateFkt(fkt);

    // view options
    setComboboxCallback("combobox20", VRGuiBits_on_viewoption_changed);
    Glib::RefPtr<Gtk::ListStore> opt_list = Glib::RefPtr<Gtk::ListStore>::cast_static(VRGuiBuilder()->get_object("view_options"));
    opt_list->clear();
    Gtk::ListStore::Row row;
    row = *opt_list->append();
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 0, "referentials", -1);
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 1, 0, -1);
    row = *opt_list->append();
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 0, "setup", -1);
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 1, 0, -1);
    row = *opt_list->append();
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 0, "lights and cameras", -1);
    gtk_list_store_set (opt_list->gobj(), row.gobj(), 1, 0, -1);
}