sechser has asked for the wisdom of the Perl Monks concerning the following question:
I wonder if it is possible to have different sorts of objects in the columns.
I know that i can have checkboxes in the first column by supplying '-checkboxes => 1' with the listbox creator. But i have no clue how to do it for other columns. Nor wether it is possible to have them on a per item basis.
I'ts a pity that Win32::GUI is so badly documented.
here a code snippet i used for trying out stuff.
#!/usr/bin/perl
use Win32::GUI;
# Creating Main Window
my $main = Win32::GUI::Window->new(-name => "Main",-width => 310 , -he
+ight => 430,-style => WS_OVERLAPPEDWINDOW | 1);
# Creating Listview
my $listview = $main->AddListView(
-title => "Listview",
-name => "Listview" ,
-width => 280 , -height => 380,
-top => 10 , -left => 10,
-fullrowselect => 0,
-gridlines => 1,
-hottrack => 0,
-style => WS_VISIBLE | 1,
);
# Inserting Columns
$listview->InsertColumn(-index => 0, -text => "Sessionname");
$listview->ColumnWidth(0,80);
$listview->InsertColumn(-index => 1, -text => "Checkboxes");
$listview->ColumnWidth(1,50);
$listview->InsertColumn(-index => 2 , -text => "BlaBla" );
$listview->ColumnWidth(2,50);
$listview->InsertItem(-item => 0 , -text => "InsertItem");
my $lvitem = $listview->Item(0);
my $lvsubitem1 = new Win32::GUI::ListView::SubItem($lvitem,1);
my $lvsubitem2 = new Win32::GUI::ListView::SubItem($lvitem,2);
my $lvckbox = new Win32::GUI::Checkbox($lvsubitem2, -checked => 1, -na
+me => "CkBx" , -text => "Chekbx");
$main->Show();
Win32::GUI::Dialog();
sub Main_Terminate {
$main->AddNotifyIcon(
-name => "Tray",
-tip => '',
-icon => '',
-id => 222,
);
-1;
}
sub Main_Minimize {
$main->Disable();
$main->Hide();
1;
}
sub CkBx_Click {
print "Radio Clicked\n";
}
cheers
thanks for all help
Re: Listview with checkboxes is it possible ?
by dada (Chaplain) on Mar 12, 2003 at 15:17 UTC
|
I'm afraid it's not possible at all. ListViews can only have checkboxes on the first item, and only on all of them.
it could be possible (I guess) with owner-drawn ListView items, but this is not currently supported by Win32::GUI.
cheers,
Aldo
King of Laziness, Wizard of Impatience, Lord of Hubris | [reply] |
Re: Listview with checkboxes is it possible ?
by PodMaster (Abbot) on Mar 12, 2003 at 13:30 UTC
|
I don't quite like the way dada does pod either, but it's there <update> and fairly well documenting (and apparently, a subitem may not be a parent to a checkbox).</update>
>tar -zxvf Win32-GUI-0.0.665.tar.gz
Win32-GUI-0.0.665/
Win32-GUI-0.0.665/Animation.xs
Win32-GUI-0.0.665/Bitmap.xs
Win32-GUI-0.0.665/BitmapInline.pm
Win32-GUI-0.0.665/BUGS
Win32-GUI-0.0.665/DC.xs
Win32-GUI-0.0.665/docs/
Win32-GUI-0.0.665/samples/
MJD says you
can't just make shit up and expect the computer to know what you mean, retardo!
I run a Win32 PPM
repository for perl 5.6x+5.8x. I take requests.
** The Third rule of perl club is a statement of fact: pod is sexy.
|
| [reply] |
|
> I don't quite like the way win32-dada does pod either
what is it that you don't like? <sarcasm>I understand that you are the PodMaster, but I like my little pods :-)</sarcasm>
cheers,
Aldo
King of Laziness, Wizard of Impatience, Lord of Hubris
PS: please drop the win32 from my nick!
| [reply] |
|
When I do the make dance, they do not get installed -- not good form.
TT2 has extra documentation and tutorials and stuff, and during the make process, they prompt and ask you if you wish to install these docs and where.
Also, Win32/GUI.pm does not contain any pod.
In the least it should say (like the readme):
I'm glad you asked.
update: Ideally, would copy all the *pod files in their appropriate spot under blib/lib/Win32/GUI, dynamically generating pod a pod file like win32gui.html (that neato indexed thing).
PS -- I use <READMORE></READMORE> tags.
MJD says you
can't just make shit up and expect the computer to know what you mean, retardo!
I run a Win32 PPM
repository for perl 5.6x+5.8x. I take requests.
** The Third rule of perl club is a statement of fact: pod is sexy.
|
| [reply] |
|
Re: Listview with checkboxes is it possible ?
by pg (Canon) on Mar 12, 2003 at 17:08 UTC
|
If you don’t mind to use Tk. You can take a look at Tk::Table, Tk::Table allows you to create a table view (if you don’t mind) with almost any Tk component as its element. If you are working on some big project, then don’t bother to migrate to Tk from Win32::GUI, probably not worth the big time you would spend. Just some food for thought.
Good luck.
| [reply] |
RE: to all that made themselves the trouble.
by Anonymous Monk on Mar 12, 2003 at 18:51 UTC
|
Thank you all that gave a reply to my mhh ... cryptic question. ;-)
I am using Activestate Perl.
And newest Win32::GUI, so far i know (the one supplied by the ppm manager of activstate).
I did not found the dok on my machine (mhh does it come by default with ppm ?).
anyway i used as a replacement:
http://search.cpan.org/author/ACALPINI/Win32-GUI-0.0.558/
The use of this documentation is very limited though.
Perl will get in conflict with the famous Dr.Watson if you try out the "easy" tutorial examples.
Just to show some options of which there is no mention in the Doc:
-fullrowselect
-gridlines
-hottrack
WS_VISIBLE
i stripped down the original script so you have a chance to understand what i'm doing, or trying to do.;-]
I had to search alot the net, and reading the modules directly. To get as far as i'm here.
I may be not an experienced user, but i tried alot before i came up with the question.
If somebody can supply me with a better doc. Already this would help me alot.
what i know from the window side, is that one can even insert progressbars into listviews. The example i saw, had them in the second row.
cheers
sechser
Note: I'm not a english native ... i just hope it's not too much visible. | [reply] |
Re: Listview with checkboxes is it possible ?
by Tomte (Priest) on Mar 12, 2003 at 13:38 UTC
|
Welcome to The Monastery, sechser,
I'm sorry I can't advise you on your question, as I have no Windows knowledge.
But may I suggest that you take a look on what you wrote and decide for yourself: Is it understandable, ist it clear?
A node asking for help could e.g. be composed like this:
- What is desired in which context?
- What is done so far
- Where the problems with "what is done so far" are located
As a first time poster you might be Interested in reading the nodes found in the Tutorials addressed to those new to The Monastery.
kind regards,
tomte
| [reply] |
|
|