Re: Please Help Me
- From: "John Hobbs" <john velvetcache org>
- To: "GTKmm List" <gtkmm-list gnome org>
- Subject: Re: Please Help Me
- Date: Tue, 28 Oct 2008 11:22:39 -0500
Are you wanting it to change color when you click on it? Or do you have a button? Or a timeout?
If you want it to change on click do something like...
Example::Example()
{
m_Color_Red.set_rgb_p(0.99, 0.00, 0.00);
m_Color_Yellow.set_rgb_p(0.
99, 0.99, 0.00);
m_Color_Green.set_rgb_p(0.00, 0.99, 0.00);
m_Color_Black.set_rgb_p(0.00, 0.00, 0.00);
add(mc_HBox);
mc_HBox.pack_start(mc_VBox, Gtk::PACK_SHRINK, 0);
m_Light1.modify_bg(Gtk::STATE_NORMAL, m_Color_Yellow);
m_Light1.set_size_request(400, 300);
m_Light1.signal_button_release_event().connect(sigc::mem_fun(*this,&Example::onClickMLight1));
mc_HBox.add(m_Light1);
show_all_children();
}
void Example::onClickMLight1 () {
m_Light1.modify_bg(Gtk::STATE_NORMAL, m_Color_Green);
}
Does that help any?
- John Hobbs
john velvetcache org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]