ui/motif/container.c

changeset 54
97bafeca1c7c
parent 53
62205699cd0e
child 59
eb6611be50c7
equal deleted inserted replaced
53:62205699cd0e 54:97bafeca1c7c
158 // add tab button 158 // add tab button
159 v->tabs = ucx_list_append_a(view->ctx->mempool->allocator, v->tabs, tab); 159 v->tabs = ucx_list_append_a(view->ctx->mempool->allocator, v->tabs, tab);
160 160
161 XmString label = XmStringCreateLocalized("tab"); 161 XmString label = XmStringCreateLocalized("tab");
162 XtSetArg(args[0], XmNlabelString, label); 162 XtSetArg(args[0], XmNlabelString, label);
163 XtSetArg(args[1], XmNshadowThickness, 1); 163 XtSetArg(args[1], XmNshadowThickness, 0);
164 XtSetArg(args[2], XmNtraversalOn, FALSE); 164 XtSetArg(args[2], XmNtraversalOn, FALSE);
165 XtSetArg(args[3], XmNtopAttachment, XmATTACH_FORM); 165 XtSetArg(args[3], XmNtopAttachment, XmATTACH_FORM);
166 XtSetArg(args[4], XmNbottomAttachment, XmATTACH_FORM); 166 XtSetArg(args[4], XmNbottomAttachment, XmATTACH_FORM);
167 XtSetArg(args[5], XmNhighlightThickness, 0); 167 XtSetArg(args[5], XmNhighlightThickness, 0);
168 XtSetArg(args[6], XmNindicatorOn, XmINDICATOR_NONE); 168 XtSetArg(args[6], XmNindicatorOn, XmINDICATOR_NONE);
169 169 XtSetArg(args[7], XmNfillOnSelect, TRUE);
170 Widget button = XmCreateToggleButton(v->tabbar, "tab_button", args, 7); 170
171 Widget button = XmCreateToggleButton(v->tabbar, "tab_button", args, 8);
171 tab->tabbedpane = v; 172 tab->tabbedpane = v;
172 tab->content = content; 173 tab->content = content;
173 tab->tab_button = button; 174 tab->tab_button = button;
174 175
175 // layout 176 // layout
187 XmATTACH_FORM, 188 XmATTACH_FORM,
188 XmNrightAttachment, 189 XmNrightAttachment,
189 XmATTACH_POSITION, 190 XmATTACH_POSITION,
190 XmNrightPosition, 191 XmNrightPosition,
191 pos + part, 192 pos + part,
193 XmNset,
194 FALSE,
192 NULL); 195 NULL);
193 is_first = FALSE; 196 is_first = FALSE;
194 } else if(i < count - 1) { 197 } else if(i < count - 1) {
195 XtVaSetValues( 198 XtVaSetValues(
196 tt->tab_button, 199 tt->tab_button,
200 pos, 203 pos,
201 XmNrightAttachment, 204 XmNrightAttachment,
202 XmATTACH_POSITION, 205 XmATTACH_POSITION,
203 XmNrightPosition, 206 XmNrightPosition,
204 pos + part, 207 pos + part,
208 XmNset,
209 FALSE,
205 NULL); 210 NULL);
206 } else { 211 } else {
207 XtVaSetValues( 212 XtVaSetValues(
208 tt->tab_button, 213 tt->tab_button,
209 XmNleftAttachment, 214 XmNleftAttachment,
210 XmATTACH_POSITION, 215 XmATTACH_POSITION,
211 XmNleftPosition, 216 XmNleftPosition,
212 pos, 217 pos,
213 XmNrightAttachment, 218 XmNrightAttachment,
214 XmATTACH_FORM, 219 XmATTACH_FORM,
220 XmNset,
221 FALSE,
215 NULL); 222 NULL);
216 } 223 }
217 pos += part; 224 pos += part;
218 i++; 225 i++;
219 } 226 }
220 227
221
222 XtManageChild(button); 228 XtManageChild(button);
229 XtVaSetValues(button, XmNset, TRUE, NULL);
223 XtAddCallback( 230 XtAddCallback(
224 button, 231 button,
225 XmNvalueChangedCallback, 232 XmNvalueChangedCallback,
226 (XtCallbackProc)ui_tab_button_callback, 233 (XtCallbackProc)ui_tab_button_callback,
227 tab); 234 tab);

mercurial