虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

XmStringCreateSimple

  • //建立按钮上标签的字符串 label = XmStringCreateSimple["Hello World!"] n = 0 XtSetArg[args[n], XmNlab

    //建立按钮上标签的字符串 label = XmStringCreateSimple["Hello World!"] n = 0 XtSetArg[args[n], XmNlabelString, label] n++ button = XmCreatePushButton[toplevel, "pushbutton", args, n] XtManageChild[button] XmStringFree[label] //设置回调函数 XtAddCallback[button, XmNactivateCallback, callback, NULL]

    标签: XmStringCreateSimple XtSetArg XmNlab label

    上传时间: 2017-03-21

    上传用户:fredguo

  • //建立顶级窗口 toplevel = XtVaAppInitialize[&app, "List", NULL, 0, &argc, argv, NULL, NULL] /

    //建立顶级窗口 toplevel = XtVaAppInitialize[&app, "List", NULL, 0, &argc, argv, NULL, NULL] //建立列表上的复合字符串 for[i=0 i<12 i++] str_months[i] = XmStringCreateSimple[months[i]] //建立列表 n = 0 XtSetArg[args[n], XmNitems, str_months] n++ XtSetArg[args[n], XmNitemCount, 12] n++ XtSetArg[args[n], XmNvisibleItemCount, 8] n++ //XtSetArg[args[n], XmNscrollBarDisplayPolicy, XmSTATIC] n++ //XtSetArg[args[n], XmNlistSizePolicy, XmCONSTANT] n++ XtSetArg[args[n], XmNselectionPolicy, XmEXTENDED_SELECT] n++ list = XmCreateScrolledList[toplevel, "list", args, n] XtManageChild[list] for[i=0 i<12 i++] XmStringFree[str_months[i]] //显示窗口 XtRealizeWidget[toplevel] //进入事件循环 XtAppMainLoop[app]

    标签: NULL XtVaAppInitialize toplevel List

    上传时间: 2013-12-21

    上传用户:asdkin