Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 14562 Details for
Bug 14297
Add a Spinner widget to the SWT toolkit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
motif c code - spin button example
spinbutton.c (text/plain), 2.28 KB, created by
Felipe Heidrich
on 2004-09-15 17:06:57 EDT
(
hide
)
Description:
motif c code - spin button example
Filename:
MIME Type:
Creator:
Felipe Heidrich
Created:
2004-09-15 17:06:57 EDT
Size:
2.28 KB
patch
obsolete
>/* numeric_simplespin.c -- demonstrate the simple spin box widget */ > >#include <Xm/Xm.h> >#include <Xm/SSpinB.h> > >char *months[] = { "January", "February", "March", "April", "May", "June", > "July", "August", "September", "October", "November", > "December" }; > >main (int argc, char *argv[]) { > Widget toplevel, simple_b; > XtAppContext app; > int n, i, l = XtNumber (months); > Arg args[8]; > XmStringTable str_list; > > XtSetLanguageProc (NULL, NULL, NULL); > > toplevel = XtVaOpenApplication (&app, "Demos", NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, NULL); > > str_list = (XmStringTable) XtMalloc (l * sizeof (XmString *)); > for (i = 0; i < l; i++) str_list[i] = XmStringCreateLocalized (months[i]); > > /*Numeric example with ints */ > n = 0; > XtSetArg (args[n], XmNspinBoxChildType, XmNUMERIC); n++; > XtSetArg (args[n], XmNminimumValue, 0); n++; > XtSetArg (args[n], XmNmaximumValue, 20); n++; > XtSetArg (args[n], XmNincrementValue, 2); n++; > XtSetArg (args[n], XmNeditable, TRUE); n++; > XtSetArg (args[n], XmNcolumns, 10); n++; > XtSetArg (args[n], XmNwrap, FALSE); n++; > > /*Numeric example with floats */ > n = 0; > XtSetArg (args[n], XmNspinBoxChildType, XmNUMERIC); n++; > XtSetArg (args[n], XmNminimumValue, 275); n++; > XtSetArg (args[n], XmNmaximumValue, 345); n++; > XtSetArg (args[n], XmNdecimalPoints, 2); n++; > XtSetArg (args[n], XmNincrementValue, 5); n++; > XtSetArg (args[n], XmNpositionType, XmPOSITION_VALUE); n++; > XtSetArg (args[n], XmNposition, 275); n++; > > /*Strings example */ > n = 0; > XtSetArg (args[n], XmNspinBoxChildType, XmSTRING); n++; > XtSetArg (args[n], XmNeditable, FALSE); n++; > XtSetArg (args[n], XmNnumValues, l); n++; > XtSetArg (args[n], XmNvalues, str_list); n++; > XtSetArg (args[n], XmNwrap, TRUE); n++; > > simple_b = XmCreateSimpleSpinBox (toplevel, "simple", args, n); > > for (i = 0; i < l; i++) XmStringFree (str_list[i]); > XtFree ((XtPointer) str_list); > > XtManageChild (simple_b); > XtRealizeWidget (toplevel); > XtAppMainLoop (app); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14297
:
14407
|
14561
| 14562 |
14563