示例#1
0
void VRGuiNet_on_del_clicked(GtkButton*, gpointer data) {
    Glib::RefPtr<Gtk::TreeView> tree_view  = Glib::RefPtr<Gtk::TreeView>::cast_static(VRGuiBuilder()->get_object("treeview9"));
    Gtk::TreeModel::iterator iter = tree_view->get_selection()->get_selected();
    if(!iter) return;

    VRGuiNet_SocketCols cols;
    Gtk::TreeModel::Row row = *iter;
    string name = row.get_value(cols.name);

    string msg1 = "Delete socket " + name;
    if (!askUser(msg1, "Are you sure you want to delete this socket?")) return;
    VRSceneManager::getCurrent()->remSocket(name);

    Glib::RefPtr<Gtk::ListStore> list_store  = Glib::RefPtr<Gtk::ListStore>::cast_static(VRGuiBuilder()->get_object("Sockets"));
    list_store->erase(iter);

    Gtk::ToolButton* b;
    VRGuiBuilder()->get_widget("toolbutton15", b);
    b->set_sensitive(false);
}
示例#2
0
文件: VRGuiNet.cpp 项目: uagmw/polyvr
void VRGuiNet_on_treeview_select(GtkTreeView* tv, gpointer user_data) {
    Gtk::ToolButton* b;
    VRGuiBuilder()->get_widget("toolbutton15", b);
    b->set_sensitive(true);
}
示例#3
0
void setToolButtonSensitivity(string toolbutton, bool b) {
    Gtk::ToolButton* tb;
    VRGuiBuilder()->get_widget(toolbutton, tb);
    tb->set_sensitive(b);
}