From be62ccd8277743636bb34b28ea94334da7eb5c95 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sun, 4 Mar 2012 13:52:26 +0100 Subject: [PATCH] Fix GtkNotebook issues. jackdbus' wasn't properly shown after widgets initialization. References: Note that due to historical reasons, GtkNotebook refuses to switch to a page unless the child widget is visible. Therefore, it is recommended to show child widgets before adding them to a notebook. (Gtk's documentation) --- bin/ladilog | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/ladilog b/bin/ladilog index 0c65b4f..4cc8d61 100755 --- a/bin/ladilog +++ b/bin/ladilog @@ -140,19 +140,20 @@ class ladilog(object): builder.connect_signals(self.event_dict) self.ui = ui = builder.get_object("ladilog_ui") + self.logview_notebook = builder.get_object ("ladilog_notebook") # Create our terminal and display it for log in self.log_files: log['scrolled_window'] = sw = Gtk.ScrolledWindow() log['term'] = term = Vte.Terminal.new () sw.set_policy(hscrollbar_policy=Gtk.PolicyType.AUTOMATIC, vscrollbar_policy=Gtk.PolicyType.ALWAYS) - #sw.set_min_content_width(400) - #sw.set_min_content_height(600) + sw.add(term) + sw.show() term.set_scroll_on_output(True) log["tab_label"] = Gtk.Label(label=log["name"]) - sw.add(term) - self.logview_notebook = builder.get_object ("ladilog_notebook") + self.logview_notebook.append_page(log["scrolled_window"], + log["tab_label"]) # Make it do something... for log in self.log_files: @@ -170,9 +171,6 @@ class ladilog(object): finally: sys.stderr.flush() - for log in self.log_files: - self.logview_notebook.append_page(log["scrolled_window"], - log["tab_label"]) ui.show_all() self.auto_updater = timeout_add(250, self.update) -- 2.11.4.GIT