[ocrfeeder] Fix ScannerChooserDialog



commit c8bdf0693cde45c772b62a5985c6302612894e1e
Author: scx <scx mail gmail com>
Date:   Wed Jan 15 20:23:52 2020 +0100

    Fix ScannerChooserDialog
    
    GtkHBox and GtkVBox have pack_start and pack_end methods. These take 4
    parameters:
    - widget
    - expand (default: True)
    - fill (default: True)
    - padding (default: 0)
    
    In PyGTK, the last three parameters were optional: if unspecified, the
    default values above were used.
    
    In PyGI, these parameters are not optional: all 4 must be specified.
    
    However, this one:
        box.pack_start(widget, True, True, 0)
    can be replaced with:
        box.add(widget)
    
    When porting to PyGI, these differences were overlooked.
    This patch fixes it by replacing incorrect calls with the correct ones.
    
    See 
https://github.com/sugarlabs/sugar-docs/blob/master/src/gtk3-porting-guide.md#hbox-vbox-pack_start-and-pack_end

 src/ocrfeeder/studio/widgetPresenter.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ocrfeeder/studio/widgetPresenter.py b/src/ocrfeeder/studio/widgetPresenter.py
index 9b74dcb..7ffbc05 100644
--- a/src/ocrfeeder/studio/widgetPresenter.py
+++ b/src/ocrfeeder/studio/widgetPresenter.py
@@ -2034,7 +2034,7 @@ class ScannerChooserDialog(Gtk.Dialog):
         self.devices = devices
         self.label = Gtk.Label('_Select one of the scanner devices found:')
         self.label.set_use_underline(True)
-        self.vbox.pack_start(self.label, padding = 5)
+        self.vbox.pack_start(self.label, expand = True, fill = True, padding = 5)
 
         self.selected_device = None
         self.__combo_box = Gtk.ComboBoxText.new()
@@ -2045,7 +2045,7 @@ class ScannerChooserDialog(Gtk.Dialog):
 
         self.__combo_box.set_active(0)
 
-        self.vbox.pack_start(self.__combo_box)
+        self.vbox.add(self.__combo_box)
 
         self.vbox.show_all()
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]