Skip to content

Commit 3fed8c8

Browse files
Merge pull request #86 from SylvainCorlay/default_selected_index
Set default selected index to 0
2 parents c6dff89 + 8307c80 commit 3fed8c8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/xwidgets/xselection_container.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <string>
1313
#include <vector>
1414

15+
#include "xtl/xoptional.hpp"
16+
1517
#include "xbox.hpp"
1618
#include "xmaterialize.hpp"
1719

@@ -35,7 +37,7 @@ namespace xw
3537
void apply_patch(const xeus::xjson&);
3638

3739
XPROPERTY(titles_type, derived_type, _titles);
38-
XPROPERTY(int, derived_type, selected_index);
40+
XPROPERTY(xtl::xoptional<int>, derived_type, selected_index, 0);
3941

4042
void set_title(typename titles_type::size_type i, std::string title);
4143

0 commit comments

Comments
 (0)