@@ -143,7 +143,15 @@ def __init__(self):
143143 self .context_id = self .get_context_id ('Statusbar' )
144144
145145 def message (self , s , n = 3 ):
146+ self .clear ()
146147 self .push (self .context_id , s )
148+ gobject .timeout_add (n * 1000 , self .clear )
149+
150+ def clear (self ):
151+ self .pop (self .context_id )
152+
153+ # To stop the timeout from firing again
154+ return False
147155
148156
149157class SuggestionWindow (gtk .Window ):
@@ -280,6 +288,7 @@ def file_prompt(self, s):
280288 buttons = (gtk .STOCK_CANCEL ,gtk .RESPONSE_CANCEL ,gtk .STOCK_OPEN ,gtk .RESPONSE_OK ))
281289 chooser .set_default_response (gtk .RESPONSE_OK )
282290 chooser .set_current_name ('test.py' )
291+ chooser .set_current_folder (os .path .expanduser ('~' ))
283292
284293 pyfilter = gtk .FileFilter ()
285294 pyfilter .set_name ("Python files" )
@@ -303,7 +312,6 @@ def file_prompt(self, s):
303312
304313 def notify (self , s , n = 10 ):
305314 self .statusbar .message (s )
306-
307315
308316class ReplWidget (gtk .TextView , repl .Repl ):
309317 __gsignals__ = dict (button_press_event = None ,
@@ -613,7 +621,10 @@ def on_suggestion_selection_changed(self, selection, word):
613621
614622
615623 def do_paste (self , widget ):
616- self .pastebin ()
624+ clipboard = gtk .clipboard_get ()
625+ paste_url = self .pastebin ()
626+ clipboard .set_text (paste_url )
627+ clipboard .store ()
617628
618629 def do_write2file (self , widget ):
619630 self .write2file ()
0 commit comments