Ejemplo n.º 1
0
class GingaScrolledViewerWidget(Widgets.WidgetBase):
    def __init__(self, viewer=None, width=600, height=600):
        super(GingaScrolledViewerWidget, self).__init__()

        if viewer is None:
            viewer = CanvasView()
        self.logger = viewer.logger

        self.viewer = viewer
        self.widget = ScrolledView(viewer)

    def scroll_bars(self, horizontal='on', vertical='on'):
        self.widget.scroll_bars(horizontal=horizontal, vertical=vertical)
Ejemplo n.º 2
0
class GingaScrolledViewerWidget(Widgets.WidgetBase):
    def __init__(self, viewer=None, width=600, height=600):
        super(GingaScrolledViewerWidget, self).__init__()

        if viewer is None:
            viewer = CanvasView(logger)
        self.logger = viewer.logger

        self.viewer = viewer
        self.widget = ScrolledView(viewer)

    def scroll_bars(self, horizontal="on", vertical="on"):
        self.widget.scroll_bars(horizontal=horizontal, vertical=vertical)
Ejemplo n.º 3
0
    def __init__(self, logger):

        self.logger = logger
        root = gtk.Window(gtk.WINDOW_TOPLEVEL)
        root.set_title("ImageViewZoom Example")
        root.set_border_width(2)
        root.connect("delete_event", lambda w, e: self.quit(w))
        self.root = root

        self.select = GtkHelp.FileSelection(root)
        vbox = gtk.VBox(spacing=2)

        # create the ginga viewer and configure it
        fi = ImageViewCanvas(logger)
        fi.enable_autocuts('on')
        fi.set_autocut_params('zscale')
        fi.enable_autozoom('on')
        fi.set_callback('drag-drop', self.drop_file)
        fi.set_bg(0.2, 0.2, 0.2)
        fi.ui_set_active(True)
        self.fitsimage = fi

        # enable some user interaction
        bd = fi.get_bindings()
        bd.enable_all(True)

        w = fi.get_widget()
        w.set_size_request(512, 512)

        # add scrollbar interface around this viewer
        si = ScrolledView(fi)
        si.scroll_bars(horizontal='on', vertical='on')

        vbox.pack_start(si, fill=True, expand=True)

        hbox = gtk.HButtonBox()
        hbox.set_layout(gtk.BUTTONBOX_END)

        wopen = gtk.Button("Open File")
        wopen.connect('clicked', self.open_file)
        wquit = gtk.Button("Quit")
        wquit.connect('clicked', self.quit)

        for w in (wopen, wquit):
            hbox.add(w)

        vbox.pack_start(hbox, fill=False, expand=False)
        root.add(vbox)
Ejemplo n.º 4
0
    def __init__(self, logger):

        self.logger = logger
        root = gtk.Window(gtk.WINDOW_TOPLEVEL)
        root.set_title("ImageViewZoom Example")
        root.set_border_width(2)
        root.connect("delete_event", lambda w, e: self.quit(w))
        self.root = root

        self.select = GtkHelp.FileSelection(root)
        vbox = gtk.VBox(spacing=2)

        # create the ginga viewer and configure it
        fi = ImageViewCanvas(logger)
        fi.enable_autocuts('on')
        fi.set_autocut_params('zscale')
        fi.enable_autozoom('on')
        fi.set_callback('drag-drop', self.drop_file)
        fi.set_bg(0.2, 0.2, 0.2)
        fi.ui_set_active(True)
        self.fitsimage = fi

        # enable some user interaction
        bd = fi.get_bindings()
        bd.enable_all(True)

        w = fi.get_widget()
        w.set_size_request(512, 512)

        # add scrollbar interface around this viewer
        si = ScrolledView(fi)
        si.scroll_bars(horizontal='on', vertical='on')

        vbox.pack_start(si, fill=True, expand=True)

        hbox = gtk.HButtonBox()
        hbox.set_layout(gtk.BUTTONBOX_END)

        wopen = gtk.Button("Open File")
        wopen.connect('clicked', self.open_file)
        wquit = gtk.Button("Quit")
        wquit.connect('clicked', self.quit)

        for w in (wopen, wquit):
            hbox.add(w)

        vbox.pack_start(hbox, fill=False, expand=False)
        root.add(vbox)