pygtk的一个易于配置的gtktreeview实现。

configtreeview的Python项目详细描述


This is an implementation of a GtkTreeView in python(using pygtk) that allows for easy, fast, and dynamic setting up of a TreeView, its TreeViewColumns and CellRenderers. This ConfigTreeView can create a TreeView with all its properties initialized through the use of a simple config-type file. This config file can be in a python dictionary format, or even read in from a JSON object.

为什么(为什么使用configTreeView?)

  • The ConfigTreeView was designed in such a way to abstract the developer from having to set up indices for how a ListStore row of data should look. The config file creates an easy way to do it and allows you to supply a row of data in python dict form(or a JSON) while initializing all the properties, columns, cell renderers that could possbily be used in creating a TreeView.
  • Eliminates the several lines of code it takes to initialize a TreeView. A TreeView is a very useful but also very complicated widget in the gtk arsenal and this implementation takes away that complication.
  • Useful for data sets that could change frequently without having to go in and change the code.–This is actually the use case that I ran into at my place of work that inspired me to create the ConfigTreeView. We have an application that many people use in the office that is connected to a server. The application gets all of the data from the server and displays it in a GtkTreeView but the data could change in the near future as we may need to display new columns or different formats of data in the same TreeView so we wanted a system set in place that could allow for us to change the data the server was sending without having to go in and change the code in the clients(i.e. the TreeView) in order to properly display the newly changed data. With a ConfigTreeView you can do just this: the server can supply a config structure to initialize the clients, eliminating the need for changing the client code.

如何使用

  • It’s easy! All you need to do is create a config file(either as a python dict in a .py file or as a JSON file).

  • Then with a config file, you’re ready to create a ConfigTreeView:

    from config_treeview import ConfigTreeView
    #Import the config structure(it's a python dict named config)
    from myconfigfile import config
    #Create a ConfigTreeView using config as the configuration structure
    treeview = ConfigTreeView(config)
    #Apply the config structure to finish initalizing the TreeView
    treeview._apply_config()
    

有关详细信息

html/目录的源代码中查看文档,从 index.html

或者访问文档:http://packages.python.org/configtreeview/

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java什么是VMObject?   java将数据插入H2数据库表   java如何修改保存在一个卡夫卡主题中的Twitter API消息并将其发送到另一个卡夫卡主题   对象Java变量别名解决方法   java返回数组在try/catch中初始化   java DateTimeFormat shortDate无年份   java我如何在recycle应用程序的首次发布中突出显示项目   java使文本区域包含大量文本,其帧响应更快   类抛出的java ClassCircularyError。forName在转换TwoStacksPlainDatagramSocketImpl类时   swing如何在GroupLayout Java中设置Jframe背景图像   sip无法在独立java应用程序上运行PJSIPJNI包装   java Android internet连接问题   java当单击按钮VerEstoque时,应用程序停止。代码上有Logcat错误,请输入h3lp   java如何在JFrame上设置图像图标动画图像将加载但不会更改   与socket一起使用时,java错误的currentTimeMillis()   Java内部字符串表示:是UTF16吗?