I would bet that Tk can do what you want. Your problem of having single line messages, being clickable, and a callback to display additional data is doable a few ways in Tk. Can you show us some code? If I was going to try an do it, I would print the results to a text widget, and create custom tags for each line printed, and tag that line. Then have a balloon, or mouse enter/clicked bindings on the tags, to display the extra data associated with that line. Here is an example, where you can store "meta-data" for each line, in a tag(or hash), and pop that data up in a balloon
when that tagged-line is clicked or enetered. You could also do it with a Canvas, if you wanted to add some graphics.
This example shows just the basics, I print the data to stdout, instead of a balloon or a toplevel extra-info window. Also, I create 100 tags in a simple loop, but in your situation, you will wnat to tagconfigure each tag, for each line, as they come in and are printed.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $mw = tkinit;
my $t = $mw->Scrolled('Text',
-scrollbars => 'osoe'
)->pack;
for(1..100){
$t->tagConfigure( 'data'.$_, -data => $_ x 20,
);
}
for(1..100){
$t->insert('end', 'Line'."$_\n", ['datarider','data'.$_ ]);
}
$t->tagBind( 'datarider', '<Enter>', sub { getdata($t) } );
$t->tagBind( 'datarider', '<Leave>', sub { getdata($t) } );
$t->bind( '<Motion>', sub{ getdata($t) } );
MainLoop;
sub getdata {
my ( $text_widget ) = @_;
my $x = $text_widget->pointerx - $text_widget->rootx;
my $y = $text_widget->pointery - $text_widget->rooty;
#print "$x $y\n";
my $txt_index = $text_widget->index( '@' . $x . ',' . $y );
#warn $txt_index;
my ( $line, $char ) = ( $txt_index =~ /^(.+?)\.(.+?)$/ );
my @tags = $text_widget->tagNames($txt_index);
print "@tags\n";
foreach my $tag(@tags){
print $text_widget->tagCget($tag,'data'),"\n";
}
}
I'm not really a human, but I play one on earth.
flash japh
| [reply] [Watch: Dir/Any] [d/l] |
wx is very cross-platform friendly, but I agree that it has a steeper learning curve. Not sure you can do much on any Win < 2K.
If the server is acting as a clearinghouse, i.e., the events are reported to it first, the GUI should not have any problems reporting them. If you are in a hurry, that's the first change I'd make: route the messages through a port on the server. Then the GUI becomes much simpler.
As far as elegance, either way you need to have a resident daemon/process queue with a known address to gather messages. Whether that's an adjunct to your existing server or another process, the function needs to be provided. | [reply] [Watch: Dir/Any] |
Usually Tk is the easiest way to go. If being platform independent, though still looking native is important, wxWidgets (wxPerl) is the way to go.
If you're worried about the learningcurve, you could try wxGlade, which allows you to build a GUI easily, and let it generate the code for you.
You might find the (GUI) Windows Programming FAQ useful...
Jouke Visser
Using Perl to enable the disabled: pVoice
| [reply] [Watch: Dir/Any] |