【问题标题】:Variable amount of checkboxes (GUI matlab)可变数量的复选框(GUI matlab)
【发布时间】:2014-10-20 01:56:32
【问题描述】:

我的编程 GUI 中有以下列表框:

    h.listbox = uicontrol('style','listbox','units','pixels',...
                          'position',[10,175,200,200],...
                          'string',components_index);

这给了我一个在列表框中包含一行股票的输出。

我现在想要的是,在每只股票的前面,我都有一个复选框。请记住,库存数量是可变的。

谁能指出解决方案?

提前致谢,

乔纳森

_______________________________________________________________--

经过帮助,我想出了以下内容:

谢谢,这就是我要找的。我现在只有一个小问题。我为 uitable 编写了代码:

h.table = uitable('units', 'pixels', 'position', [10, 100, 200, 200], ...
                     'columnname', {'Yes/No'},...
                     'columnformat',{'logical'},...
                     'ColumnEditable', true,...
                     'rowname',components_index);

但我无法点击我的文本框。它们都按应有的方式显示,但无法更改其值。

【问题讨论】:

  • 带有适当column settingsuitable 可能是更适合使用的GUI 对象。
  • 谢谢,如果您有时间看,我更新了我的问题,非常感谢!

标签: matlab user-interface checkbox listbox


【解决方案1】:

尝试定义数据字段(例如,使用false 填充复选框列):

components_index = {'one1','two2','three3'};
h.table = uitable('units', 'pixels', 'position', [10, 100, 200, 200], ...
                         'columnname', {'Yes/No'},...
                         'columnformat',{'logical'},...
                         'ColumnEditable', true,...
                         'rowname',components_index,...
                         'data',false(numel(components_index),1));

【讨论】:

  • 太棒了!完美运行!非常感谢!
猜你喜欢
  • 2012-04-19
  • 2015-01-18
  • 2014-05-09
  • 2010-10-21
  • 2012-06-30
  • 1970-01-01
  • 2014-06-03
  • 2014-10-29
  • 2013-05-06
相关资源
最近更新 更多