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

Paul LeoNerd Evans leonerd at leonerd.org.uk
Fri Jun 15 17:21:24 BST 2012


On Fri, Jun 15, 2012 at 12:46:04AM +0100, Tom Molesworth wrote:
> 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).

Yeah, just to clarify a bit here. The middle Window layer should be
happy to support floating windows (asides from the scrollrect bug that I
need to fix), but I haven't put much thought into how the Widget layer
will cope with that. I wanted to get the Window layer working enough
with the idea to make me happy to start thinking about Windows in the C
library. Widgets in C are a loooong way off yet so I'm less worried
about that.

We probably need to think some more about input handling for these
though; it may be that some kinds of modal/popup dialog widget will want
focus/input stealing.

> Apart from silly things like me not understanding how to
> use Tickit::Pen properly

A case for some more documentation here perhaps? What would be needed?

> or returning false from on_key handlers and
> seeing all the widgets moving in unison when keys are pressed,

I did the very same in circle-fe-term. :) I'm beginning to wonder about
a helper WidgetRole for doing key bindings, which would handle that sort
of thing automatically.

> 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?

Ironically perhaps I'm not the best person to think up some examples. My
use of it is centred around circle-fe-term, and the CelBot console.
These are both very irssi-like in their interface layout - switchable
tabs of scrolling formatted text, which is otherwise static, and a
readline-alike entry box for controlling it. I haven't put too much
thought into more GUI-like interaction models.

> 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.

We could take some inspiration from

  http://developer.gnome.org/gtk/2.24/ch02.html

When I have the C library in a bit more of a releaseable state
(currently I'm working on a full set of manpages), I'll create a page on
my website, looking similar to the existing libtermkey one

  http://home.leonerd.org.uk/code/libtermkey/

Could probably host some screenshots and the like here too. I don't
think making a CPAN example of just examples is necessarily the way to
go on this one. If we want things like screenshots, CPAN dists make them
harder to host; I think a real website works better. Possibly we could
have, as apeiron suggested, a Task:: bundle that pulls in all the known
widget types.

> 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.

Can I put my totally-selfish oar in a moment and wonder where that
Tangence object browser went? :) That would be highly useful to my
Circle hackery...

> 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.

There's quite a class of widget types that could be created now without
floating window support even; which is a clone of the sorts usually
found in GUI toolkits. Things like

 * Button
 * CheckBox
 * RadioBox
 * ProgressBar
 * ValueBar - I'm thinking something like the scroll bar position
     indicators
 * Some sort of "choose a value from this fixed list" box

If we want to play the "modal dialog" game some more there's likely
potential to come up with a cheap easy way to create a modal dialog to
ask one question. Maybe something like:

  my ( $name ) = Tickit::QuickDialog->new(
    title => "What is your name?",
    widgets => [qw( Entry )],
    buttons => [qw( OK Cancel )],
  )->run;

</back-of-envelope>

-- 
Paul "LeoNerd" Evans

leonerd at leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://mail.leonerd.org.uk/pipermail/tickit-dev/attachments/20120615/d8fec7ee/attachment.sig>


More information about the Tickit-dev mailing list