summaryrefslogtreecommitdiff
path: root/gtk/gtkprinteroptionwidget.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-07-26 09:34:08 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-07-26 18:09:54 -0400
commitf7ab6f665d405c0eaa20da4491e4550d867bd9cf (patch)
treeea48453bb9da6b437ed9970f992b6604ddbd6b9d /gtk/gtkprinteroptionwidget.c
parentef6babf896cd06bd42d0fb11e3aae7c109708bdd (diff)
downloadgtk+-f7ab6f665d405c0eaa20da4491e4550d867bd9cf.tar.gz
dropdown: Revise constructors
A dropdown without a model is useless, so accept a model and expression in the constructor. Allow them to be NULL, but consume them if given. This makes chained constructors convenient without breaking language bindings. Drop gtk_drop_down_set_from_strings() and instead add gtk_drop_down_new_from_strings(). Update all users.
Diffstat (limited to 'gtk/gtkprinteroptionwidget.c')
-rw-r--r--gtk/gtkprinteroptionwidget.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkprinteroptionwidget.c b/gtk/gtkprinteroptionwidget.c
index 59cb79b113..200eef8a39 100644
--- a/gtk/gtkprinteroptionwidget.c
+++ b/gtk/gtkprinteroptionwidget.c
@@ -37,6 +37,7 @@
#include "gtktogglebutton.h"
#include "gtkorientable.h"
#include "gtkprivate.h"
+#include "gtkstringlist.h"
#include "gtkprinteroptionwidget.h"
@@ -479,7 +480,7 @@ combo_box_entry_new (void)
gtk_widget_add_css_class (hbox, "linked");
entry = gtk_entry_new ();
- button = gtk_drop_down_new ();
+ button = gtk_drop_down_new (NULL, NULL);
combo_box_set_model (button);
factory = gtk_signal_list_item_factory_new ();
@@ -506,7 +507,7 @@ combo_box_new (void)
{
GtkWidget *combo_box;
- combo_box = gtk_drop_down_new ();
+ combo_box = gtk_drop_down_new (NULL, NULL);
combo_box_set_model (combo_box);
combo_box_set_view (combo_box);
@@ -938,8 +939,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
const char * strings[2];
strings[0] = _("Not available");
strings[1] = NULL;
- priv->combo = gtk_drop_down_new ();
- gtk_drop_down_set_from_strings (GTK_DROP_DOWN (priv->combo), strings);
+ priv->combo = gtk_drop_down_new_from_strings (strings);
gtk_drop_down_set_selected (GTK_DROP_DOWN (priv->combo), 0);
gtk_widget_set_sensitive (GTK_WIDGET (widget), FALSE);
gtk_widget_show (priv->combo);