From 860754f7e871617df9d101a51dc64a69b742a0ba Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Mon, 21 Feb 2011 21:03:02 +0000 Subject: fixed problem with help label wrap width --- (limited to 'TurtleArtActivity.py') diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index c9aa9cb..aa8d5bd 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -43,7 +43,8 @@ from gettext import gettext as _ import os.path import tarfile -from TurtleArt.taconstants import PALETTE_NAMES, OVERLAY_LAYER, HELP_STRINGS +from TurtleArt.taconstants import PALETTE_NAMES, OVERLAY_LAYER, HELP_STRINGS, \ + ICON_SIZE from TurtleArt.taexporthtml import save_html from TurtleArt.taexportlogo import save_logo from TurtleArt.tautils import data_to_file, data_to_string, data_from_string, \ @@ -572,7 +573,7 @@ class TurtleArtActivity(activity.Activity): _("Shrink blocks"), self.do_shrink_blocks_cb, view_toolbar_button) self.hover_help_label = self._add_label( _("Move the cursor over the orange palette for help."), - help_toolbar) + help_toolbar, gtk.gdk.screen_width() - 2 * ICON_SIZE) # The palette toolbar is only used with 0.86+ if self.new_sugar_system: @@ -780,10 +781,12 @@ class TurtleArtActivity(activity.Activity): self.tw.paste_offset) self.tw.paste_offset += 20 - def _add_label(self, string, toolbar): + def _add_label(self, string, toolbar, width=None): """ add a label to a toolbar """ label = gtk.Label(string) label.set_line_wrap(True) + if width is not None: + label.set_size_request(width, -1) label.show() toolitem = gtk.ToolItem() toolitem.add(label) -- cgit v0.9.1