0

I am searching for a GTK Object that displays a text (only one line), but I need the text to be bigger than in a Statusbar (and maybe that I can change the font and italic/bold etc).

Normally, I created a GTKStatusbar that displays a text when I click on a button. (I created the program with Glade):

self.statusbar = self.builder.get_object("statusbar")
self.searchbutton = self.builder.get_object("searchbutton")

def on_searchbutton_clicked(self, widget):
    self.statusbar.push(1, "Hello world!")

But with this method I can't display the text with a bigger letter size.

Can you please help me with my problem?

Thanks in advance.

slashcrack
  • 123
  • 8
  • 1
    see http://www.kksou.com/php-gtk2/articles/change-the-font-of-GtkTextView.php or http://stackoverflow.com/questions/3737021/use-the-system-monospace-font-in-gtk-textview – Joran Beasley Sep 20 '12 at 18:29

1 Answers1

1

A Gtk.Label has a property called "use-markup" which lets you use Pango Text Markup in the label. For example:

label = Gtk.Label()
label.set_use_markup(True)
label.set_markup("<big>This is bigger text</big>")

You could either use the GtkLabel as the statusbar (for a very, very simple statusbar) or you could extend GtkStatusbar and pack your label into it there.

Micah Carrick
  • 9,967
  • 3
  • 31
  • 43