Skip to content

Instantly share code, notes, and snippets.

@sapier
Created February 23, 2014 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sapier/9177671 to your computer and use it in GitHub Desktop.
Save sapier/9177671 to your computer and use it in GitHub Desktop.
std::wstring wlabel = narrow_to_wide(label.c_str());
FieldSpec spec(
narrow_to_wide(name.c_str()),
wlabel,
L"",
258+m_fields.size()
);
spec.ftype = f_Button;
if(type == "button_exit")
spec.is_exit = true;
errorstream << "Buttonlabel1: " << wide_to_narrow(wlabel.c_str()) << std::endl;
gui::IGUIButton* e = Environment->addButton(rect, this, spec.fid, wlabel.c_str());
if (spec.fname == data->focused_fieldname) {
Environment->setFocus(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment