Send data on a signal_button_press_event
- From: Iker Perez de Albeniz <ialbeniz cbt es>
- To: gtkmm-list gnome org
- Subject: Send data on a signal_button_press_event
- Date: Thu, 27 Sep 2007 13:47:06 +0200
I'am creating DrawingAreas and i want to add an action when i clik on
them..
**********************************************************************
(*nDrawingArea).set_events(Gdk::BUTTON_PRESS_MASK);
(*nDrawingArea).signal_button_press_event
().connect(sigc::mem_fun(*this, &colorSelectorWindow::setColor1));
bool colorSelectorWindow::setColor1(GdkEventButton* event){
int Color = 65535;
std::ostringstream o;
o << "00";
for (int k=2*sizeof(int) - 7; k>=0; k--) {
o << "0123456789ABCDEF"[((Color/257 >> k*4) & 0xF)];
}
o << "FF";
m_ColorHex.set_text(o.str());
aux_Color.set_rgb(0,Color,65535);
m_SelectedColor.modify_bg(Gtk::STATE_NORMAL,
Gdk::Color(aux_Color));
return true;
}
****************************************************************************
The problem is that i want to send an int on the event so i have tried
this..
***********************************************************
(*nDrawingArea).signal_button_press_event
().connect(sigc::bind<int>( sigc::mem_fun(*this,
&colorSelectorWindow::setColor1), colour_p));
void colorSelectorWindow::setColor1(int Color){
std::ostringstream o;
o << "00";
for (int k=2*sizeof(int) - 7; k>=0; k--) {
o << "0123456789ABCDEF"[((Color/257 >> k*4) & 0xF)];
}
o << "FF";
m_ColorHex.set_text(o.str());
aux_Color.set_rgb(0,Color,65535);
m_SelectedColor.modify_bg(Gtk::STATE_NORMAL, Gdk::Color(aux_Color));
return true;
}
****************************************
but doenst work.. any idea?
thanks
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]