Changes

Jump to navigation Jump to search
Line 131: Line 131:  
# If '''expand''' was not set, use value True
 
# If '''expand''' was not set, use value True
 
# If '''fill''' was not set, use value True. (however, if expand is False, this parameter gets ignored so False is an equally acceptable option when expand=False)
 
# If '''fill''' was not set, use value True. (however, if expand is False, this parameter gets ignored so False is an equally acceptable option when expand=False)
# If padding was not set, use value 0.
+
# If '''padding''' was not set, use value 0.
    
These parameters can be specified either as positional arguments or as named keyword arguments, however all 4 must always be specified. Some developers prefer keyword arguments, arguing that the following:
 
These parameters can be specified either as positional arguments or as named keyword arguments, however all 4 must always be specified. Some developers prefer keyword arguments, arguing that the following:
Line 147: Line 147:  
This is as far as you need to go for now. However, in GTK3, GtkVBox and GtkHBox have been deprecated, which means they might be removed in GTK4. The replacement is to use GtkBox directly, and you may wish to make this change now. e.g.:
 
This is as far as you need to go for now. However, in GTK3, GtkVBox and GtkHBox have been deprecated, which means they might be removed in GTK4. The replacement is to use GtkBox directly, and you may wish to make this change now. e.g.:
 
<pre>vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)</pre>
 
<pre>vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)</pre>
 
+
<pre>hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, homogeneous=True, spacing=8)</pre>
 
However, it must be noted that if GtkBox is used directly (instead of using GtkHBox/GtkVBox), the default value of '''expand''' is now '''False'''. The implications of this are:
 
However, it must be noted that if GtkBox is used directly (instead of using GtkHBox/GtkVBox), the default value of '''expand''' is now '''False'''. The implications of this are:
 
# You need to check your .add() calls, as previously they would behave as pack_start with expand=True, but now they will behave as expand=False (you need to change them to use pack_start with expand=True to retain the old behaviour)
 
# You need to check your .add() calls, as previously they would behave as pack_start with expand=True, but now they will behave as expand=False (you need to change them to use pack_start with expand=True to retain the old behaviour)
2

edits

Navigation menu