コード例 #1
0
void Caramelo::set_relief(Gtk::ReliefStyle newstyle){

	Glib::RefPtr<Gtk::StyleContext> stylecontext =
		this->get_style_context();

	switch(newstyle){
		case Gtk::RELIEF_NORMAL:
			stylecontext->add_class("event_box_relief_normal");
			break;
		default:
			stylecontext->remove_class("event_box_relief_normal");
			break;
	}

	stylecontext->context_save();
	this->queue_draw();
};
コード例 #2
0
Ipwindow::Ipwindow()
	: m_VBox(Gtk::ORIENTATION_VERTICAL),
	m_Button_conectar("Conectar"), /*m_check("Active para registrarse"), */
	m_Button_registrar("Registrar"),
	img("../share/candycrash/imagenes/star_big.png") {
	set_size_request(350, 700);
	set_title("Conectate");

	m_VBox.pack_start(menubar, Gtk::PACK_SHRINK, 0);

	menubar.signal_quit().connect(sigc::mem_fun(*this, &Ipwindow::on_salir));
	menubar.signal_help().connect(sigc::mem_fun(*this,&Ipwindow::on_help));
	menubar.signal_about().connect(sigc::mem_fun(*this,&Window::on_about));

	//m_Button_conectar.override_color(Gdk::RGBA("cornsilk"),Gtk::STATE_FLAG_NORMAL);
	add(m_VBox);

	m_VBox.pack_start(img, true, false, 0);

	m_VBox.pack_start(m_host, true, false, 0);
	m_host.set_label(string("Ip:Puerto"));

	m_host.set_text(string("localhost:9000"));

	m_VBox.pack_start(m_user, true, false, 0);
	m_user.set_label(string("Usuario"));

	m_pass.set_visibility(false);
	m_VBox.pack_start(m_pass, true, false, 0);
	m_pass.set_label(string("Password"));

	//m_VBox.pack_start(m_check, true, false, 0);

	m_VBox.pack_start(m_text, true, true, 0);

	m_VBox.add(m_HBox);

	but_box.pack_start(m_Button_conectar, true, true, 80);
	but_box.pack_start(m_Button_registrar, true, true, 80);
	m_Button_box.pack_start(but_box, true, true, 80);
	m_Button_conectar.signal_clicked().connect(sigc::mem_fun(*this,
				&Ipwindow::on_button_conectar));

	m_Button_registrar.signal_clicked().connect(sigc::mem_fun(*this,
				&Ipwindow::on_button_registrar));
	m_VBox.pack_start(m_Button_box, true, false, 0);
	m_Button_conectar.set_can_default();
	m_Button_conectar.grab_default();

	Glib::RefPtr<Gtk::StyleContext> stylecontext =
		m_Button_conectar.get_style_context();
	stylecontext->add_class("btn");
	stylecontext->context_save();

	stylecontext =
		m_Button_registrar.get_style_context();
	stylecontext->add_class("btn1");
	stylecontext->context_save();

	show_all_children();
	show_all();
}