How to override OK button in TGui::ColorPicker

Started by LeeDev, 08 January 2024, 02:18:34

LeeDev

I know this is a skill issue on my part but I cannot find any examples online.

I am trying to make a ColorPicker which was easy enough:

void GuiManager::OnClickColorPickerTool()
{
canDraw = false;
tgui::ColorPicker::Ptr colorPicker = tgui::ColorPicker::create();
gui.add(colorPicker);
}

However I am trying to figure out how I can override the button funtionalliy for Okay and Cancel. I was reading the docs page but no functions seem to match what I am looking for. Can someone help me out? Thank you!

LeeDev

I think I solved it. I thought signals were passed as strings to connect, I didnt know you could acces them as memebers.

void GuiManager::OnClickColorPickerTool()
{
canDraw = false;
tgui::ColorPicker::Ptr colorPicker = tgui::ColorPicker::create();
colorPicker->onOkPress.connect(&GuiManager::Test, this);
gui.add(colorPicker);
}