I've been a lurker on this list for some time now (probably a year or
more), but I finally got time in the last few weeks to start playing
with Win32::GUI properly. Firstly can I thank the regulars for a great
set of features, and to say what an improvement V1.0 is over what I had
played with before.
I have been thinking about this wrapper idea for some time, as there are
a number of useful 'widgets' that I would keep reusing, and think they
could be packaged up for others to use. Initially I was thinking of GUI
framework items: examples are splash screens, about boxes and the like,
that virtually every UI wants in order to look professional, but is the
almost the same over and over again. If nothing else these could serve
as great examples of what can be done.
Whilst I don't have anything to contribute in this vein right now, I
though this might be a good moment to introduce HyperLink.pm - a
sub-classing of Win32::GUI::Label that acts as a clickable hyperlink:
Headline features are:
- change of cursor to 'hand' when hovering over the label
- by default text is blue rather than black
- by default text gets underlined when the mouse is hovering
- by default link gets launched in browser when clicked
- takes all options available to Win32::GUI::Label class
- all defaults can be turned off or otherwise controlled
There is more documentation in the file itself, and a demo script
available at http://www.robmay.me.uk/win32gui/
Is this sort of packaging appropriate for others to use? I'd appreciate
feedback on whether more 'widgets' like this might be useful.
Ariel Serbin wrote:
>Thanks for the responses...
>That's good to know about Text() on the comboboxes.
>I've been doing it the other way, as well.
>I'm not sure if there's any weirdness related to
>having the 0-width column because I always do
>fullrowselect. I've thought about the shadow array
>idea before and it is probably the best way to go.
>One of the benefits to having the hidden field is that
>I can expand it when debugging my code, but that
>doesn't seem to be a good reason to design the wrapper
>in that manner. Now that I think about it, the array
>would probably be best for consistency, since there's
>nowhere to hide a key field in the comboboxes.
>I'm not exactly sure how I would like to implement
>this either. It would be cool to be able to do
># get some data
>$sth = $dbh->prepare('select person_id, first_name,
>last_name from people');
># call a method to assign ids and populate the LV.
># if called without a key field it could
># automagically assign ids
># suppose we have a button to remove items
># from the LV
> $id = $lv_wrapper->id();
> return 1;
>The neat thing about the hashref idea is that columns
>could be named just by setting the AS params in the
>sql and everything would be taken care of. This is a
>decent model for when I'm building gui elements from a
>DB, but it doesn't really match up to situations where
>I build elements from an array of objects.
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>Perl-Win32-GUI-Users mailing list