设为首页
收藏本站
用户名
Email
自动登录
找回密码
密码
登录
注册
快捷导航
平台
Portal
论坛
BBS
文库
项目
群组
Group
我的博客
Space
搜索
搜索
热搜:
shell
linux
mysql
本版
用户
LinuxSir.cn,穿越时空的Linuxsir!
»
论坛
›
编程开发讨论区 —— LinuxSir.cn
›
Linux 程序设计专题讨论
›
请教gtk1.2中items()的功能
返回列表
查看:
555
|
回复:
1
请教gtk1.2中items()的功能
[复制链接]
Annie0716
Annie0716
当前离线
积分
22
IP卡
狗仔卡
发表于 2005-9-13 09:40:16
|
显示全部楼层
|
阅读模式
程序是基于gtk1.2的,里面有一些list,用到了list->items()
现在我需要将程序移植到gtk2.0上,看了一下说明,原来的list好像都需要换成TreeView,
可是list原来的一些函数我看不明白功能,不知道具体应该怎么替换
请教一下:items()的功能是怎样的?
谢谢了!
Gtk:
ist * list_avail;
Gtk:
ist * list_source;
Gtk:
ist * list_mirror;
Gtk:
ist * list_spare;
Gtk:
ist::SelectionList &sl = list_avail->selection ();
Gtk:
ist::ItemList &src_items = list_source->items ();
Gtk:
ist::ItemList &mir_items = list_mirror->items ();
Gtk:
ist::ItemList &spr_items = list_spare->items ();
......
if (src_items.empty()) {
AddDevListItem (list_source, pDisk);
} else if (mir_items.empty()) {
AddDevListItem (list_mirror, pDisk);
} else {
AddDevListItem (list_spare, pDisk);
}
// move the focus to a list not empty
Gtk:
ist::ItemList &avail_items = list_avail->items ();
src_items = list_source->items ();
mir_items = list_mirror->items ();
if (!avail_items.empty())
list_avail->select_item (0);
else if (!src_items.empty())
list_source->select_item (0);
else if (!mir_items.empty())
list_mirror->select_item (0);
else {
// can not reach here
ASSERT(0);
}
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
显身卡
Annie0716
Annie0716
当前离线
积分
22
IP卡
狗仔卡
楼主
|
发表于 2005-9-23 15:13:37
|
显示全部楼层
实验证明:
Gtk:
ist::ItemList &spr_items = list_spare->items ();
在gtkmm中可以用TreeModel::Children 来替换
回复
支持
反对
使用道具
举报
显身卡
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
服务器架设、应用、维护
SuSE Linux
Copyright © 2002-2023
LinuxSir.cn
(http://www.linuxsir.cn/) 版权所有 All Rights Reserved.
Powered by
RedflagLinux!
技术支持:
中科红旗
|
京ICP备19024520号
快速回复
返回顶部
返回列表