File tree 2 files changed +23
-6
lines changed
2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -80,17 +80,18 @@ Adw.StatusPage {
80
80
};
81
81
}
82
82
83
- Adw.ComboRow {
83
+ Adw.ComboRow drop_down {
84
84
title: _("Choose an Item");
85
85
subtitle: _("List of options from a drop down");
86
+ enable-search: true;
86
87
87
88
model: StringList list {
88
89
strings [
89
- "This ",
90
- "Is ",
91
- "A ",
92
- "String ",
93
- "List "
90
+ "Cat ",
91
+ "Dog ",
92
+ "Hippo ",
93
+ "Duck ",
94
+ "Dodo "
94
95
]
95
96
};
96
97
}
Original file line number Diff line number Diff line change
1
+ import GObject from "gi://GObject" ;
2
+ import Gtk from "gi://Gtk" ;
3
+
4
+ const drop_down = workbench . builder . get_object ( "drop_down" ) ;
5
+
6
+ drop_down . connect ( "notify::selected-item" , ( ) => {
7
+ const selected_item = drop_down . selected_item . get_string ( ) ;
8
+ console . log ( selected_item ) ;
9
+ } ) ;
10
+
11
+ const expression = new Gtk . ClosureExpression (
12
+ GObject . TYPE_STRING ,
13
+ ( obj ) => obj . string ,
14
+ null ,
15
+ ) ;
16
+ drop_down . expression = expression ;
You can’t perform that action at this time.
0 commit comments