Ok, Great woirk by the "HammerCrewe" and thanks to all
I am trying to see how we cab feed an url into thehammer from an external app ( a mail client for example) or from the commad line
From an earlier script I spotted this example which we can addapt into the current script I think, there is also an example of how we can add the http:// to addresses if its not entered
if len(sys.argv) > 1:
url = sys.argv[1]
else:
url = DEFAULT_URL
gtk.gdk.threads_init()
browser = SimpleBrowser()
browser.open(url)
browser.show()
def on_active(self, widget, data=None):
'''When the user enters an address in the bar, we check to make
sure they added the http://, if not we add it for them. Once
the url is correct, we just ask webkit to open that site.'''
url = self.url_bar.get_text()
try:
url.index("://")
except:
url = "http://"+url
self.url_bar.set_text(url)
self.web_view.open(url)
The other Question i have relates to hiding the toolbar with a keybinding, I notice that there is line that say 'if toolbar true @ doe this mean ther is a toggle state?
def __init__(self, location_enabled=True, toolbar_enabled=True):
gtk.Toolbar.__init__(self)
Not sure if this makes sence as I am flagging a bit today, I will have a coffee of 5 and see if that helps.
EDIT - added both sets of code for review
Jase