From: Michael N. <MN...@Ja...> - 2002-04-23 15:20:08
|
Hi, I am not a C/C++ programmer but a Perl programmer. Nothing against C/C++ of course I wish I had the time to learn it. I've read part of "GNU C++ for Linux" so I understand basically C/C++ syntax, prototypes, data structures, etc... however IMHO at least one example is sorely needed for each class *or* at least 80% of them. The reason being is that as a Perl programmer trying to make the leap to GUI programming (vs. CGI/HTML) I need to get started quickly! I believe the examples that are included in wxPerl are not through enough. What I mean to say is that in addition to seeing the wxPerl an explanation of GUI programming in Perl terms would go along way to getting Perl programmers started quickly. I'm under contract really wanted (and still do!) to write a GUI application that would run locally on the customers computer-- a content management system for their web site but I couldn't make the leap quickly enough so I am writing it in DHTML and Win32::OLE instead. : ( Mattia, if you wouldn't mind answering a lot of questions so I could pick your brain. I would definitely consider creating these numerous examples and associated explanations. I love Perl and would enjoying championing the Wx library. Michael ----- Original Message ----- From: <wxp...@li...> To: <wxp...@li...> Sent: Monday, April 22, 2002 7:15 PM Subject: wxperl-users digest, Vol 1 #147 - 4 msgs > Send wxperl-users mailing list submissions to > wxp...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/wxperl-users > or, via email, send a message with subject or body 'help' to > wxp...@li... > > You can reach the person managing the list at > wxp...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of wxperl-users digest..." > > > Today's Topics: > > 1. RFI: What people find confusing in wxWindows docs? (Mattia Barbon) > 2. Re: Associating data with listctrl items (Mattia Barbon) > 3. Re: Associating data with listctrl items (Nick Johnston) > 4. default window colour (Dave Roe) > > --__--__-- > > Message: 1 > From: "Mattia Barbon" <mb...@ds...> > To: wxp...@li... > Date: Sun, 21 Apr 2002 22:47:05 +0200 > Reply-to: mb...@ds... > Subject: [wxperl-users] RFI: What people find confusing in wxWindows docs? > > Given that Perl programmers find wxWindows documentation > ( written for C++ ) confusing, I'd like to know what exactly > people think is confusing. Knowing that I may think some way > of improving the documentation ( no promises, though ). > > Thanks > Mattia > > > > --__--__-- > > Message: 2 > From: "Mattia Barbon" <mb...@ds...> > To: Nick Johnston <sk...@er...> > Date: Sun, 21 Apr 2002 22:47:05 +0200 > Subject: Re: [wxperl-users] Associating data with listctrl items > Reply-to: mb...@ds... > CC: wxp...@li... > > You forgot platform & wxPerl version, so I won't give you the solution ;-p > > > I have got a wxPerl application that contains a Wx::TreeCtrl and a > > Wx::ListCtrl. Whenever a Wx::TreeCtrl item is activated, new items > > are inserted in the list control. The "items" are stored as > > data in the tree control. > > > > I am attempting to supply a hashref as data for each item in the > > list control. So, in my EVT_TREE_SEL_CHANGED callback function > > I have the following code: > > <snip> > > > Adding the actual *items* works fine (they display properly in the list). > > The only problem is that setting the item data simply *does not work*. > > Bizarrely, whenever I print out $id in the above function, it is > > *always* zero. > > > > Anyway in my EVT_LIST_ITEM_ACTIVATED callback function I have: > > > > my $file_details = $object->{list}->GetItemData($event->GetItem()); > > > > but this causes a message box to appear saying: > > > > "Cannot retrieve information for list control item XXXXXXXX" (i.e. it > > includes the item number). > I see; this: the problem is that GetItemData takes the index of the item > $list->GetItemData( $ebent->GetIndex() ), or $event->GetData() works fine > > > I think the problem is that there is no SetPlData etc. for listctrl like > > there is for treectrl. The C++ documentation seems to show that > > a listctrl item can only have a 'long' associated with it. > Yes, you can use the long as an index in an array ( or in an hash ) containing > the hashrefs, though. > > > How can I associate a hashref with each item in a listctrl and how I > > can access this hashref when the item is "activated"? > See above > > HTH > Mattia > > > > --__--__-- > > Message: 3 > Date: Mon, 22 Apr 2002 05:53:01 -0700 (PDT) > From: Nick Johnston <sk...@er...> > To: Mattia Barbon <mb...@ds...> > cc: <wxp...@li...> > Subject: Re: [wxperl-users] Associating data with listctrl items > > On Sun, 21 Apr 2002, Mattia Barbon wrote: > > > You forgot platform & wxPerl version, so I won't give you the solution ;-p > > > > Win32, ActivePerl 5.6.1 build 628, wxPerl 0.09 -- sorry for not including > before. > > > I see; this: the problem is that GetItemData takes the index of the item > > $list->GetItemData( $ebent->GetIndex() ), or $event->GetData() works fine > > > > Yes, you can use the long as an index in an array ( or in an hash ) containing > > the hashrefs, though. > > > > Ok, so I should have a hash keyed on the long and then have the value for > that key be a hashref? > > Could you provide some sample code, please? I would really appreciate it. > I'm confused that the $id in my original code is always 0. I would really > appreciate some sample code here. > > > > How can I associate a hashref with each item in a listctrl and how I > > > can access this hashref when the item is "activated"? > > See above > > > > I would appreciate it if you could produce a simple snippet of code to > illustrate this (inserting an item, storing its data in a global hash > keyed on the long and then retrieving). > > I'm still pretty new to Wx and finding it pretty difficult. > > - Nick > > > > --__--__-- > > Message: 4 > Date: Mon, 22 Apr 2002 11:17:28 -0700 > From: Dave Roe <dav...@ma...> > To: wxPerl Users <wxp...@li...> > Subject: [wxperl-users] default window colour > > Win2K > Perl 5.6.1 > wxWindows 2.2.9 > wxPerl 0.10 > > how do you determine the default window colour? the wxWindows docs point > at wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW) but > wxSystemSettings does not seem to be supported by wxPerl (although > wxSYS_COLOUR_WINDOW does have an entry in _Exp.pm) > > thanks, > /dave > > > > > --__--__-- > > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users > > > End of wxperl-users Digest > |