Widget::Widget(Widget *parent) { setParent(parent); //TODO: do this in setParent if (parent) parent->add(this); setSensitive(true); repaint(); }
void initClientLayout(GtkWidget *window) { GtkWidget *menubar; GtkWidget *main_vbox; //main vertical box widget GtkWidget *button_hbox; //buttons horizon box widget GtkWidget *separator; //separator widget //Create a vbox to put menubar, image, and 3 buttons main_vbox = gtk_vbox_new(FALSE, BOX_SPACING_SIZE); //Set the border width of man_vbox gtk_container_set_border_width(GTK_CONTAINER(main_vbox), BORDER_WIDTH_SIZE); //Add the main_vbox into the window gtk_container_add(GTK_CONTAINER(window), main_vbox); //Create the menubar from itemfactoryentry menubar = getMenubarMenu(window); //Pack the menubar into the main_vbox gtk_box_pack_start(GTK_BOX(main_vbox), menubar, FALSE, TRUE, 0); //Create the toolbar toolbar = getToolbar(); //Pack the toolbar into the main_vbox gtk_box_pack_start(GTK_BOX(main_vbox), toolbar, FALSE, TRUE, 0); //Create a image to play the video image = gtk_image_new_from_file(VIDEO_ICON); //Pack the image into the main_vbox gtk_box_pack_start(GTK_BOX(main_vbox), image, TRUE, TRUE, 0); //Create a separator separator = gtk_hseparator_new(); //Pack the separator into the main_vbox gtk_box_pack_start(GTK_BOX(main_vbox), separator, FALSE, TRUE, 0); //Create a hbox to put 3 buttons button_hbox = gtk_hbox_new(TRUE, BOX_SPACING_SIZE); //Pack the button_hbox into the main_vbox gtk_box_pack_start(GTK_BOX(main_vbox), button_hbox, FALSE, TRUE, 0); //Create the setup button setupButton = getButton(button_hbox, GTK_STOCK_NETWORK, "Setup", "Setup RTSP Connection"); //Create the play button playButton = getButton(button_hbox, GTK_STOCK_MEDIA_PLAY, "Play", "Play Streaming Video"); //Create the teardown button teardownButton = getButton(button_hbox, GTK_STOCK_MEDIA_STOP, "Teardown", "Teardown RTSP Connection"); //Set the sensitive property of buttons setSensitive(TRUE, FALSE, FALSE); return; }
Entry::Entry( pp::Vec2d pos, pp::Vec2d size, const char *binding, const char *content ) : mp_font(NULL) { m_position = pos; m_size = size; m_content = content; mp_font = pp::Font::get(binding); m_editable=true; m_maxchars=8; setSensitive(true); }
void recentFileMenu(GtkRecentChooser *chooser,gpointer *data) { gchar *uri=NULL; char *filename; uri=gtk_recent_chooser_get_current_uri((GtkRecentChooser*)chooser); if(uri!=NULL) { filename=g_filename_from_uri((const gchar*)uri,NULL,NULL); closePage(NULL,NULL); doOpenManpage(filename); dirty=false; setSensitive(); g_free(uri); g_free(filename); } }
int main(int argc,char **argv) { gtk_init(&argc,&argv); init(); buildMainGui(); buildFindReplace(); if(argc>1) doOpenManpage(argv[1]); dirty=false; setSensitive(); refreshMainWindow(); gtk_window_set_default_icon_name(PACKAGE); gtk_window_set_icon_name((GtkWindow*)window,PACKAGE); gtk_main(); }
SourceDialog::SourceDialog(Glib::RefPtr < Gtk::Builder >& xml, std::map < std::string, std::string > pParam, std::string pIncludes, std::string pConstructor, std::string pMembers) : mXml(xml) { //~ xml->get_widget("SourceDialog", mDialog); //~ xml->get_widget("NotebookSource", mNotebook); xml->get_widget("ParametersDialog", mDialog); xml->get_widget("IncludeText", mIncludes); xml->get_widget("ConstructorText", mConstructor); xml->get_widget("MembersText", mMembers); xml->get_widget("addParam", mAddParam); xml->get_widget("delParam", mDelParam); xml->get_widget("nameParam", mNameParam); mNameParam->set_editable(false); xml->get_widget("valueParam", mValueParam); xml->get_widget("treeViewParam", mTreeViewParam); mParam = pParam; mIncludes->get_buffer()->set_text(pIncludes); mConstructor->get_buffer()->set_text(pConstructor); mMembers->get_buffer()->set_text(pMembers); initTreeParam(); fillParam(); initMenuPopupTreeParam(); mList.push_back(mAddParam->signal_clicked().connect( sigc::mem_fun(*this, &SourceDialog::onAddParam))); mList.push_back(mDelParam->signal_clicked().connect( sigc::mem_fun(*this, &SourceDialog::onDeleteParam))); m_cntParamButtonRelease = mTreeViewParam-> signal_button_release_event().connect( sigc::mem_fun( *this, &SourceDialog::onButtonRealeaseParam)); m_cntParamCursorChanged = mTreeViewParam-> signal_cursor_changed().connect( sigc::mem_fun( *this, &SourceDialog::onCursorChangeParam)); setSensitive(false); }
int QTweetStatusUpdateWithMedia::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QTweetNetBase::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 2) qt_static_metacall(this, _c, _id, _a); _id -= 2; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 2) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 2; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = status(); break; case 1: *reinterpret_cast< QString*>(_v) = imageFilename(); break; case 2: *reinterpret_cast< bool*>(_v) = isSensitive(); break; case 3: *reinterpret_cast< qint64*>(_v) = inReplyToStatusID(); break; case 4: *reinterpret_cast< double*>(_v) = latitude(); break; case 5: *reinterpret_cast< double*>(_v) = longitude(); break; case 6: *reinterpret_cast< QString*>(_v) = placeID(); break; case 7: *reinterpret_cast< bool*>(_v) = displayCoordinates(); break; } _id -= 8; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setStatus(*reinterpret_cast< QString*>(_v)); break; case 1: setImageFilename(*reinterpret_cast< QString*>(_v)); break; case 2: setSensitive(*reinterpret_cast< bool*>(_v)); break; case 3: setReplyToStatusID(*reinterpret_cast< qint64*>(_v)); break; case 4: setLatitude(*reinterpret_cast< double*>(_v)); break; case 5: setLongitude(*reinterpret_cast< double*>(_v)); break; case 6: setPlaceID(*reinterpret_cast< QString*>(_v)); break; case 7: setDisplayCoordinates(*reinterpret_cast< bool*>(_v)); break; } _id -= 8; } else if (_c == QMetaObject::ResetProperty) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 8; } else if (_c == QMetaObject::RegisterPropertyMetaType) { if (_id < 8) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 8; } #endif // QT_NO_PROPERTIES return _id; }