how to use pango markup in messagedialog text using variable
For example this code
void usb_boot::creation(){
//Gtk::MessageDialog dialogue(*this, listeDeroulante.get_active_text());
std::string message("Type de formatage : " + type), type1, chemin1;
Gtk::MessageDialog *dialogue = new Gtk::MessageDialog("Résumé", true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO);
dialogue->set_title("Résumé");
dialogue->set_message("<span weight='bold'>message</span>",true);
dialogue->set_secondary_text("<b>listeDeroulante.get_active_text()</b>", true);
dialogue->set_default_response(Gtk::RESPONSE_YES);
int result = dialogue->run();
set_message
and set_secondary_text
have to print variables but just "see" word.
Is there a way to read like variables ?
While the
std::stringstream
solution works, I would suggest using simple string concatenation, throughstd::string
'soperator+
:With this solution, no need to introduce an extra
type
.