Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - chrishox

#1
Hi, again.
I've recently switched one widget from an 'EditBox' to a 'TextBox' but it did not behave as I would have thought:



//// This responded they way I wanted: to both 'setText()' and to keyboard entry
//auto box{ tgui::EditBox::create() };
//box->connect(tgui::Signals::EditBox::TextChanged, []() { /* worked as expected */ });

// This does *not* respond when 'setText()' is called, but does respond to keyboard entry
auto box{ tgui::TextBox::create() };
box->connect(tgui::Signals::TextBox::TextChanged, []() { /* deaf to 'setText()' */ });

// This only seems to send the "TextChanged" signal when 'box' is an EditBox (not a TextBox)
box->setText("hi");



It appears I could be missing something obvious; might someone be able to point me down the proper path?
#2
Help requests / CheckBoxRenderer
17 April 2020, 01:03:24
Does 'CheckBoxRenderer' exist in ver 0.8? (I notice it once existed in ver 0.7.)

I am attempting:
Code (cpp) Select

#include "header.h"

#include <TGUI/Loading/Theme.hpp>
#include <TGUI/Renderers/CheckBoxRenderer.hpp> // <-- This doesn't exist
//#include <TGUI/Renderers/RadioButtonRenderer.hpp> // <-- This doesn't help

void Implementation()
{
  auto theme{ tgui::Theme::getDefault() };
  tgui::CheckBoxRenderer widgetRenderer{ theme->getRenderer("CheckBox") }; // <-- No such thing as 'CheckBoxRenderer'
  //tgui::RadioButtonRenderer widgetRenderer{ theme->getRenderer("RadioButton") }; // <-- Doesn't affect check boxes
  widgetRenderer.setTextColor(..); // <-- I want to accomplish this
}


I thought perhaps it had been rolled into 'RadioButtonRenderer' but that does not appear to work.
Any help would be appreciated; thanks!