After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 684863 - Identation error in python code of http://developer.gnome.org/gnome-devel-demos/unstable/separator.py.html.en
Identation error in python code of http://developer.gnome.org/gnome-devel-dem...
Status: RESOLVED FIXED
Product: gnome-devel-docs
Classification: Applications
Component: platform-demos
unspecified
Other Linux
: Normal minor
: ---
Assigned To: gnome-devel-docs maintainers
gnome-devel-docs maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-26 11:13 UTC by Carlos Soriano
Modified: 2014-01-26 23:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Carlos Soriano 2012-09-26 11:13:16 UTC
Code fixed:

from gi.repository import Gtk
import sys

class MyWindow(Gtk.ApplicationWindow):
    def __init__(self, app):
        Gtk.Window.__init__(self, title="Separator Example", application=app)

        # three labels
        label1 = Gtk.Label()
        label1.set_text("Below, a horizontal separator.")

        label2 = Gtk.Label()
        label2.set_text("On the right, a vertical separator.")

        label3 = Gtk.Label()
        label3.set_text("On the left, a vertical separator.")

        # a horizontal separator
        hseparator = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL)
        # a vertical separator
        vseparator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL)

        # a grid to attach labels and separators
        grid = Gtk.Grid()
        grid.attach(label1, 0, 0, 3, 1)
        grid.attach(hseparator, 0, 1, 3, 1)
        grid.attach(label2, 0, 2, 1, 1)
        grid.attach(vseparator, 1, 2, 1, 1)
        grid.attach(label3, 2, 2, 1, 1)
        grid.set_column_homogeneous(True)
        # add the grid to the window
        self.add(grid)

class MyApplication(Gtk.Application):
    def __init__(self):
        Gtk.Application.__init__(self)

    def do_activate(self):
        win = MyWindow(self)
        win.show_all()

app = MyApplication()
exit_status = app.run(sys.argv)
sys.exit(exit_status)
Comment 1 David King 2014-01-26 23:06:04 UTC
Fixed in master as 7791e68b2934fedbbfc2f6065828cdb14b6e6c8e.