Editing PyMaemo/HildonDesktop
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 24: | Line 24: | ||
import gtk | import gtk | ||
import hildondesktop | import hildondesktop | ||
+ | |||
+ | class HelloWorldButton(gtk.Button): | ||
+ | def __init__(self, padding): | ||
+ | gtk.Button.__init__(self) | ||
+ | icon_theme = gtk.icon_theme_get_default() | ||
+ | icon = icon_theme.load_icon("hello", 40, 0) | ||
+ | if icon is None: | ||
+ | icon = icon_theme.load_icon("qgn_list_gene_default_app", 40, 0) | ||
+ | icon_image = gtk.Image() | ||
+ | icon_image.set_from_pixbuf(icon) | ||
+ | icon_image.set_padding(padding, padding) | ||
+ | self.add(icon_image) | ||
+ | self.show_all() | ||
class HelloWorldDialog(gtk.Dialog): | class HelloWorldDialog(gtk.Dialog): | ||
Line 41: | Line 54: | ||
def __init__(self): | def __init__(self): | ||
hildondesktop.HomePluginItem.__init__(self) | hildondesktop.HomePluginItem.__init__(self) | ||
- | button = | + | button = HelloWorldButton(10) |
button.connect("clicked", hello_world_dialog_show) | button.connect("clicked", hello_world_dialog_show) | ||
button.show_all() | button.show_all() |
Learn more about Contributing to the wiki.