Gtk::Widget * PathParam::param_newWidget() { Gtk::HBox * _widget = Gtk::manage(new Gtk::HBox()); Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(param_label)); static_cast<Gtk::HBox*>(_widget)->pack_start(*pLabel, true, true); pLabel->set_tooltip_text(param_tooltip); Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("tool-node-editor"), Inkscape::ICON_SIZE_BUTTON) ); Gtk::Button * pButton = Gtk::manage(new Gtk::Button()); pButton->set_relief(Gtk::RELIEF_NONE); pIcon->show(); pButton->add(*pIcon); pButton->show(); pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_edit_button_click)); static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true); pButton->set_tooltip_text(_("Edit on-canvas")); pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-copy"), Inkscape::ICON_SIZE_BUTTON) ); pButton = Gtk::manage(new Gtk::Button()); pButton->set_relief(Gtk::RELIEF_NONE); pIcon->show(); pButton->add(*pIcon); pButton->show(); pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_copy_button_click)); static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true); pButton->set_tooltip_text(_("Copy path")); pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) ); pButton = Gtk::manage(new Gtk::Button()); pButton->set_relief(Gtk::RELIEF_NONE); pIcon->show(); pButton->add(*pIcon); pButton->show(); pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_paste_button_click)); static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true); pButton->set_tooltip_text(_("Paste path")); pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-clone"), Inkscape::ICON_SIZE_BUTTON) ); pButton = Gtk::manage(new Gtk::Button()); pButton->set_relief(Gtk::RELIEF_NONE); pIcon->show(); pButton->add(*pIcon); pButton->show(); pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_link_button_click)); static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true); pButton->set_tooltip_text(_("Link to path on clipboard")); static_cast<Gtk::HBox*>(_widget)->show_all_children(); return dynamic_cast<Gtk::Widget *> (_widget); }
static void gradsel_style_button(GtkWidget *gtkbtn, char const *iconName) { Gtk::Button *btn = Glib::wrap(GTK_BUTTON(gtkbtn)); GtkWidget *child = sp_icon_new(Inkscape::ICON_SIZE_SMALL_TOOLBAR, iconName); gtk_widget_show(child); btn->add(*manage(Glib::wrap(child))); btn->set_relief(Gtk::RELIEF_NONE); }
Gtk::Widget * OriginalPathParam::param_newWidget() { Gtk::HBox *_widget = Gtk::manage(new Gtk::HBox()); { // Label Gtk::Label *pLabel = Gtk::manage(new Gtk::Label(param_label)); static_cast<Gtk::HBox*>(_widget)->pack_start(*pLabel, true, true); pLabel->set_tooltip_text(param_tooltip); } { // Paste path to link button Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon( GTK_STOCK_PASTE, Inkscape::ICON_SIZE_BUTTON) ); Gtk::Button *pButton = Gtk::manage(new Gtk::Button()); pButton->set_relief(Gtk::RELIEF_NONE); pIcon->show(); pButton->add(*pIcon); pButton->show(); pButton->signal_clicked().connect(sigc::mem_fun(*this, &OriginalPathParam::on_link_button_click)); static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true); pButton->set_tooltip_text(_("Link to path")); } { // Select original button Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon("edit-select-original", Inkscape::ICON_SIZE_BUTTON) ); Gtk::Button *pButton = Gtk::manage(new Gtk::Button()); pButton->set_relief(Gtk::RELIEF_NONE); pIcon->show(); pButton->add(*pIcon); pButton->show(); pButton->signal_clicked().connect(sigc::mem_fun(*this, &OriginalPathParam::on_select_original_button_click)); static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true); pButton->set_tooltip_text(_("Select original")); } static_cast<Gtk::HBox*>(_widget)->show_all_children(); return dynamic_cast<Gtk::Widget *> (_widget); }
Gtk::Button * FrameDial::create_icon(Gtk::IconSize iconsize, const char * stockid, const char * tooltip) { iconsize = Gtk::IconSize::from_name("synfig-small_icon_16x16"); Gtk::Image *icon = Gtk::manage(new Gtk::Image(Gtk::StockID(stockid), iconsize)); Gtk::Button *button = Gtk::manage(new class Gtk::Button()); button->add(*icon); button->set_tooltip_text(tooltip); icon->set_padding(0, 0); icon->show(); button->set_relief(Gtk::RELIEF_NONE); button->show(); return button; }
Gtk::Button * ZoomDial::create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & stockid, const char * tooltip) { Gtk::Button *button = manage(new class Gtk::Button()); Gtk::Image *icon = manage(new Gtk::Image(stockid, size)); button->add(*icon); button->set_tooltip_text(tooltip); icon->set_padding(0, 0); icon->show(); button->set_relief(Gtk::RELIEF_NONE); button->show(); return button; }
void myg_make_image_button(Gtk::Button &button, const Glib::RefPtr<Gdk::Pixbuf> &image, const Glib::ustring &label) { Gtk::Alignment *alig= Gtk::manage(new Gtk::Alignment(0.5,0.5,0.0,0.0)); Gtk::HBox *box= Gtk::manage(new Gtk::HBox(false, 2)); alig->add(*box); box->pack_start(*Gtk::manage(new Gtk::Image(image)), false, false); box->pack_start(*Gtk::manage(new Gtk::Label(label)), false, false); button.add(*alig); alig->show_all(); }
int NetLogGuiGtkWindow::on_service_added(fawkes::NetworkService *service) { if ( ntb_logviewers.get_n_pages() == 0 ) { lab_no_connection->hide(); //Gtk::Container *thiscon = this; //thiscon->remove(lab_no_connection); //add(ntb_logviewers); ntb_logviewers.show(); } Gtk::HBox *hbox = Gtk::manage(new Gtk::HBox(false, 4)); Gtk::Button *button = Gtk::manage(new Gtk::Button()); Gtk::Image *image = Gtk::manage(new Gtk::Image(Gtk::Stock::CONNECT, Gtk::ICON_SIZE_BUTTON)); button->add(*image); button->set_relief(Gtk::RELIEF_NONE); Gtk::Label *label = Gtk::manage(new Gtk::Label()); label->set_markup(Glib::ustring("<b>") + service->host() + "</b>\n" + service->addr_string()); label->set_line_wrap(); Gtk::Label *invisible = Gtk::manage(new Gtk::Label(Glib::ustring(service->name()) + "::" + service->type() + "::" + service->domain())); Gtk::ScrolledWindow *scrolled = Gtk::manage(new Gtk::ScrolledWindow()); scrolled->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); LogView *logview = Gtk::manage(new LogView(service->addr_string().c_str(), service->port())); //scrolled->add(*logview); hbox->pack_start(*button); hbox->pack_start(*label); hbox->pack_start(*invisible); button->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &NetLogGuiGtkWindow::on_connbut_clicked), image, logview)); logview->get_connection_dispatcher()->signal_connected().connect(sigc::bind(sigc::mem_fun(*this, &NetLogGuiGtkWindow::on_connected), image)); logview->get_connection_dispatcher()->signal_disconnected().connect(sigc::bind(sigc::mem_fun(*this, &NetLogGuiGtkWindow::on_disconnected), image)); scrolled->show(); label->show(); image->show(); button->show(); logview->show(); hbox->show(); int rv = ntb_logviewers.append_page(*logview, *hbox); return rv; }