Merge lp:~gero-bare/scratch/scratch-fix-dialog-warning into lp:~elementary-apps/scratch/scratch

Proposed by Gero.Bare
Status: Merged
Approved by: Danielle Foré
Approved revision: 1574
Merged at revision: 1574
Proposed branch: lp:~gero-bare/scratch/scratch-fix-dialog-warning
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 11 lines (+1/-1)
1 file modified
src/Services/TemplateManager.vala (+1/-1)
To merge this branch: bzr merge lp:~gero-bare/scratch/scratch-fix-dialog-warning
Reviewer Review Type Date Requested Status
Danielle Foré Approve
Review via email: mp+274666@code.launchpad.net

Commit message

Cast dialog content area as box to pack scroll. Fixes runtime warning.

Description of the change

Fix a strange runtime warning:

[_LOG_LEVEL_WARN 03:26:48.464941] [Gtk] Attempting to add a widget with type GtkScrolledWindow to a GtkDialog, but as a GtkBin subclass a GtkDialog can only contain one widget at a time; it already contains a widget of type GtkBox

This is due a dialog not expecting to be added a ScrolledWindow, now it should be fine, no more warning.

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

Can confirm it does what it says :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Services/TemplateManager.vala'
2--- src/Services/TemplateManager.vala 2015-09-16 01:11:55 +0000
3+++ src/Services/TemplateManager.vala 2015-10-16 06:33:58 +0000
4@@ -207,7 +207,7 @@
5 scroll.add_with_viewport (grid);
6 scroll.set_shadow_type (Gtk.ShadowType.NONE);
7
8- dialog.add (scroll);
9+ (dialog.get_content_area() as Gtk.Box).pack_start(scroll);
10 //register_template ("text-editor", "Sample", "sample template", typeof(TestTemplate));
11 }
12

Subscribers

People subscribed via source and target branches