guyblade.com #/


PSN
Gamercard


2009 Oct 01 anthy


Guy Blade Guy Blade---02:58:00


On Hexes
Mono, the .NET environment in which XPost is written, has a large number of handy libraries that have been written for it over the past few years. Many of these libraries provide invaluable services such as GTK compatibility. Others are more like novelties. One such novelty is the Curses binding set. They allow you to program console things using the .NET framework. Obviously, this has little true use, however, since XPost was already written in Mono/.NET, it provides a decent way to get a command-line client for blog posting.

Unfortunately, the MonoCurses environment has a lot lacking. Firstly, there is basically no documentation. Figuring out how it works essentially requires you to read the source code to see what it is doing with each of the widgets that have been provided. Luckily, the sum total of code for the entire UI framework is on the order of a few klocs, and most classes are more like 50-100 lines. The second issue is that there are some outright lies in the inline documentation. For instance, the inline documentation states that the Move(y,x) function, when called by a container, is relative to the upper left corner of the container. This is a complete lie. Move always works in absolute coordinates. Thirdly, the provided framework lacked a multi-line editing widget. Obviously, such a thing was required in order to make a blogging tool work, so I got to roll my own. This task wasn't so much difficult as it was complex. There were many things that had to be done very precisely else the whole experiences would be terrible. My multi-line editing widget is larger (in lines of code) than any provided widget by about 100%. Fourthly, there are many things which require precise incantations to prevent crashes. The example here is removing a widget from a container. It would seem the simple way would be to simply remove it from its parent using the Remove method. However, doing so results in the program crashing when you attempt to move to the next widget via tab. Instead, you must mark the widget to be removed as unfocusable, tell the parent to set the focus on the next available widget, then remove the widget. This is excessively tedious for something that should be a one-liner. Finally, the renderers for certain widgets seem to do bizarre things without explaination. The ListView widget (which I use for listing the blogs to be included during posting) apparently renders about 6 lines worth of garbage after it finishes listing the items in the list view. I can find no cause for this. I have disabled my custom renderer for it, but find that whenever the ListView renderer is called, this behavior manifests. I find it quite annoying.


Regardless, I have a minimally functional XPost client right now that runs in the happy safety of a console. The next step is to add support for the various configuration options (such as adding blogs).



Published by XPostcurses


Permalink to this post     Com/0

Front Page

Archive
Copyright 2002-2024 Blade Libergnosis//Powered By Blogger