4
4
static uiSpinbox * spinbox ;
5
5
static uiSlider * slider ;
6
6
static uiProgressBar * pbar ;
7
+ static uiCheckbox * checkbox ;
7
8
8
9
#define CHANGED (what ) \
9
10
static void on ## what ## Changed(ui ## what *this, void *data) \
@@ -75,6 +76,18 @@ static void selectNone(uiButton *b, void *data)
75
76
uiRadioButtonsSetSelected (rb , -1 );
76
77
}
77
78
79
+ static void sliderEnableTooltip (uiButton * b , void * data )
80
+ {
81
+ uiSliderSetHasTooltip (uiSlider (data ), 1 );
82
+ uiCheckboxSetChecked (checkbox , uiSliderHasTooltip (uiSlider (data )));
83
+ }
84
+
85
+ static void sliderDisableTooltip (uiButton * b , void * data )
86
+ {
87
+ uiSliderSetHasTooltip (uiSlider (data ), 0 );
88
+ uiCheckboxSetChecked (checkbox , uiSliderHasTooltip (uiSlider (data )));
89
+ }
90
+
78
91
uiBox * makePage4 (void )
79
92
{
80
93
uiBox * page4 ;
@@ -93,6 +106,21 @@ uiBox *makePage4(void)
93
106
uiSliderOnChanged (slider , onSliderChanged , NULL );
94
107
uiBoxAppend (page4 , uiControl (slider ), 0 );
95
108
109
+ hbox = newHorizontalBox ();
110
+ slider = uiNewSlider (0 , 100 );
111
+ uiBoxAppend (hbox , uiControl (slider ), 1 );
112
+ b = uiNewButton ("Enable Tooltip" );
113
+ uiButtonOnClicked (b , sliderEnableTooltip , slider );
114
+ uiBoxAppend (hbox , uiControl (b ), 0 );
115
+ b = uiNewButton ("Disable Tooltip" );
116
+ uiButtonOnClicked (b , sliderDisableTooltip , slider );
117
+ uiBoxAppend (hbox , uiControl (b ), 0 );
118
+ checkbox = uiNewCheckbox ("Has Tooltip" );
119
+ uiControlDisable (uiControl (checkbox ));
120
+ uiCheckboxSetChecked (checkbox , uiSliderHasTooltip (slider ));
121
+ uiBoxAppend (hbox , uiControl (checkbox ), 0 );
122
+ uiBoxAppend (page4 , uiControl (hbox ), 0 );
123
+
96
124
pbar = uiNewProgressBar ();
97
125
uiBoxAppend (page4 , uiControl (pbar ), 0 );
98
126
0 commit comments