From bd74630c00b50484dd8ecfbeab33935078093d41 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Fri, 25 Sep 2009 17:00:46 +0000 Subject: no longer used as we moved help to the toolbar --- (limited to 'palettes.py') diff --git a/palettes.py b/palettes.py deleted file mode 100644 index e1ba9a7..0000000 --- a/palettes.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2009, Raúl Gutiérrez Segalés -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -import os -import tempfile -import urlparse -from gettext import gettext as _ -import gobject - -import gtk - -from sugar.graphics.palette import Palette, Invoker -from sugar.graphics.menuitem import MenuItem -from sugar.graphics.icon import Icon -from sugar import profile -from sugar.activity import activity - - -class ContentInvoker(Invoker): - - def __init__(self, help_message): - Invoker.__init__(self) - self._position_hint = self.AT_CURSOR - self.palette = BlockHelpPalette(help_message) - - def get_default_position(self): - return self.AT_CURSOR - - def get_rect(self): - return gtk.gdk.Rectangle() - - def get_toplevel(self): - return None - - def showPopup(self, data = ""): - if self.palette.is_up() == False: - self.palette.popup() - gobject.timeout_add(1500, self.close_palette, "") - - def close_palette(self, data = ""): - self.palette.popdown() - - -class BlockHelpPalette(Palette): - def __init__(self, help_message): - Palette.__init__(self) - - self._help_message = help_message - - self.props.primary_text = help_message -- cgit v0.9.1