File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -80,17 +80,18 @@ Adw.StatusPage {
8080 };
8181 }
8282
83- Adw.ComboRow {
83+ Adw.ComboRow drop_down {
8484 title: _("Choose an Item");
8585 subtitle: _("List of options from a drop down");
86+ enable-search: true;
8687
8788 model: StringList list {
8889 strings [
89- "This ",
90- "Is ",
91- "A ",
92- "String ",
93- "List "
90+ "Cat ",
91+ "Dog ",
92+ "Hippo ",
93+ "Duck ",
94+ "Dodo "
9495 ]
9596 };
9697 }
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