Created
July 6, 2017 19:21
-
-
Save tanyuan/58ff6ff16cb592ee3dc2fd9fe867fc00 to your computer and use it in GitHub Desktop.
GNOME Files (Nautilus) Python extension simple info bar example. Put in ~/.local/share/nautilus-python/extensions/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gi.repository import Gtk, Nautilus, GObject | |
class LocationProviderExample(GObject.GObject, Nautilus.LocationWidgetProvider): | |
def __init__(self): | |
pass | |
def get_widget(self, uri, window): | |
vb = Gtk.VBox() | |
bar = Gtk.InfoBar() | |
vb.pack_start(bar, False, False, 0) | |
bar.set_message_type(Gtk.MessageType.INFO) | |
bar.get_content_area().pack_start( | |
Gtk.Label(uri), | |
False, False, 0) | |
vb.show_all() | |
return vb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment