87 GtkWidget * eventBox=gtk_event_box_new();
90 GtkWidget *label=gtk_label_new(nf.
str);
91 gtk_container_add((GtkContainer *)eventBox,label);
93 g_signal_connect(G_OBJECT(eventBox),
"button_press_event", G_CALLBACK(nf.
func), nf.
data);
95 gtk_widget_show (label);
123 string pangoString; pangoString=pangoString+
"<span "+str+
">%s</span>";
124 char *markup = g_markup_printf_escaped (pangoString.c_str(), gtk_label_get_text(GTK_LABEL(
current())));
125 gtk_label_set_markup(GTK_LABEL(
current()), markup);
145 gtk_misc_set_alignment (GTK_MISC(
current()), xalign, yalign);
170 if (pangoFontDescription)
171 gtk_widget_modify_font(
current(),pangoFontDescription);
180 gtk_label_set_angle(GTK_LABEL(
current()), angle);
188 gtk_label_set_text(GTK_LABEL(
current()), text);
196 return gtk_label_get_text(GTK_LABEL(
current()));
217 cout<<
"Labels::~Labels"<<endl;
void setLabelsFont(PangoFontDescription *pangoFontDescription)
GtkWidget * current(void)
return a pointer to the current lug
Labels & operator=(const char *text)
class to create and handle labels.
GtkWidget * getWidget(void)
returns the current GtkWidget* in the list
void pangoMarkup(Pango &p)
Set the pango markup of the currently displayed text. The Pango class is used to setup the label...
void setLabelText(GtkWidget *l)
GtkWidget * setAlignment(float xalign, float yalign)
void setAngle(double angle)
void setText(const char *text)
gpointer data
The data to pass to func when the button it pressed.
const char * str
The label to show in the button.
void add(TYPE newElement)
Adds as the current element ... Added to the next of the current lug.
class to pass using operator<< for creating a label button
void pangoMarkup(const char *str)
Set the pango markup of the currently displayed text. Allows you to set the current text to different...
void(* func)()
The function to call when the button is pressed.
const char * getText(void)
Labels & operator=(string text)
Labels & operator<<(std::string str)