[Tickit-dev] Floating windows and demo apps was Re: Released: Tickit 0.17

Tom Molesworth tickit at entitymodel.com
Fri Jun 15 00:46:04 BST 2012


Hi all,

Just wanted to highlight one item in the release notes, since for me 
it's one of the more useful developments in the last few months:

On 13/06/12 09:55, Paul LeoNerd Evans wrote:
>    0.17 adds new concepts of hidden and floating windows...
>

What this means in practise is that you don't have to jump through hoops 
to get menus, popup dialogs, overlays and other staple UI elements. 
Finally got around to trying this the other day and it's remarkably 
straightforward to use as well, instead of calling ->make_sub on a 
window to get a non-overlapping subwindow there's a new ->make_float 
method. Armed with just that information - well, maybe ->show / ->hide 
as well - and the code in examples/demo-float.pl, you can get modal 
dialogs and the like without too much effort.

So far it's looking really good - only issues I've run into so far are 
around other widgets trying to scroll the terminal and perhaps a slight 
lack of clarity on how to handle widgets with floating windows (should 
they be orphans or just attached to other container widgets as usual?) 
and key/mouse event handling (currently I hook the on_key events for the 
parent window that the floating windows are created under, then unhook 
when the floats are removed, not sure yet whether that's the right way 
or not). Pretty good going for code which was freshly committed just a 
few days ago - I was expecting the whole overlapping-windows concept to 
take a lot more effort to get right.

At this point Tickit seems to have most of the pieces I'd be looking for 
in a text-based windowing toolkit. I know there's a fair bit of 
development going on at the moment to bring the C version of the code up 
to a similar level of functionality but from the Perl side of things I'm 
happy using what we have already for putting together interfaces. Apart 
from silly things like me not understanding how to use Tickit::Pen 
properly or returning false from on_key handlers and seeing all the 
widgets moving in unison when keys are pressed, I'm finding Tickit to be 
an excellent complement to IO::Async-based code. One thing that's maybe 
needing attention is some demonstration applications which show the API 
in context, with examples of all the widgets currently available on CPAN 
so it's easier to see how to put things together - like Wx::Demo or 
gtk-demo maybe?

If that makes sense, the next question is "where should they be?" - 
entries under examples/ in the main distribution or a separate CPAN 
distribution ("Tickit::Examples" or something) would be a start, 
although for better visibility maybe a webpage somewhere with 
screenshots and code snippets would be a more accessible source of 
information. I'd be happy to put some time into working on examples if 
anyone has suggestions - maybe something along the lines of a file 
manager, text editor, spreadsheet, SQL or DBIx::Class query editor / 
result browser, i.e. big enough that it's an excuse to show off a range 
of widgets, but not a massive project that's impossible to finish. In a 
similar vein, what's missing on the widgets front? I think there's work 
in progress for menus, and there are a few implementations of modal 
dialogs ('about' box, file selection, popup form for user/password 
entry) around which will probably end up in CPAN sooner or later.

cheers,

Tom



More information about the Tickit-dev mailing list