本文整理汇总了C++中Fl_Choice::text方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Choice::text方法的具体用法?C++ Fl_Choice::text怎么用?C++ Fl_Choice::text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Choice
的用法示例。
在下文中一共展示了Fl_Choice::text方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: choice_cb
static void choice_cb(Fl_Widget* w, void* s) {
Fl_Choice* c = (Fl_Choice*)w;
SaverPrefs* sp = (SaverPrefs*)s;
const char* saver_name = c->text();
if(!saver_name)
return;
/* when we want to disable it */
if(strcmp(saver_name, "(None)") == 0) {
xscreensaver_kill_preview();
/* just draw an empty box */
Fl_Box* b = new Fl_Box(0, 0, 180, 134);
preview_win->add(b);
preview_win->redraw();
sp->mode = SAVER_OFF;
return;
}
/* FIXME: for now only one is allowed */
sp->mode = SAVER_ONE;
/* find the name matches in our list and run it's command */
HackListIter it = sp->hacks.begin(), it_end = sp->hacks.end();
for(; it != it_end; ++it) {
if((*it)->name == saver_name) {
xscreensaver_preview(fl_xid(preview_win), (*it)->exec.c_str());
sp->curr_hack = (*it)->sindex;
break;
}
}
}
示例2: repchooser_cb
static void repchooser_cb(Fl_Widget *w, void *v) {
Fl_Choice *c = (Fl_Choice *)w;
if (c->value())
((SaveTrajectoryFltkMenu *)v)->select_atoms(c->text());
}