Re: Another FruitBasket with Wx

  • From: "inthaneelf" <inthaneelf@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Sun, 18 Nov 2007 12:22:15 -0800

nono, I meant that I had gotten your E mail, saved it for the info in it, and downloaded and saved your .rar package to my comp for conversion to .zip and upload to the site when I have figured out what is wrong with the sights download links.


regards,
inthane
. For Blind Programming assistance, Information, Useful Programs, and Links to Jamal Mazrui's Text tutorial packages and Applications, visit me at:
http://grabbag.alacorncomputer.com
. to be able to view a simple programming project in several programming languages, visit the Fruit basket demo site at:
http://fruitbasketdemo.alacorncomputer.com

----- Original Message ----- From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Sunday, November 18, 2007 12:48 AM
Subject: Re: Another FruitBasket with Wx


No you don't have it. You have one made by Jamal which is much bigger and harder to understand by a beginner. This one I've made is much simpler. It uses a shorter way of creating a Wx application using Wx::SimpleApp instead of defining first the app then the frame, and it is more correctly done because the window created is a normal window and not a dialog window. It also doesn't use a layout manager that can be harder to understand by a beginner that tries to learn the WxPerl interface, but it just specifies the positions for each of the forms elements.

(And it also doesn't import constants that are not used in the program).

Octavian

----- Original Message ----- From: "inthaneelf" <inthaneelf@xxxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Sunday, November 18, 2007 8:09 AM
Subject: Re: Another FruitBasket with Wx


alright, I do believe I have it, thanks

now all I have to do if find out why half the links on my page are suddenly not working, *sigh*

anyway, it may not be up there immediately, but it will get there soon, after I find the current problem.

you have a great day,
inthane
. For Blind Programming assistance, Information, Useful Programs, and Links to Jamal Mazrui's Text tutorial packages and Applications, visit me at:
http://grabbag.alacorncomputer.com
. to be able to view a simple programming project in several programming languages, visit the Fruit basket demo site at:
http://fruitbasketdemo.alacorncomputer.com

----- Original Message ----- From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, November 17, 2007 11:56 AM
Subject: Another FruitBasket with Wx


Hi,

I've made another FruitBasket made with Wx in perl. I've seen that the syntax of WxPerl is not so nice as the syntax of Win32::GUI, but I thought that the source code should be smaller, because it doesn't use that hash-style of providing parameters to functions.

Finally I've made a Fruit Basket with WxPerl that has only around 750 characters, and it is still pretty clear. The version below has 950 characters because it has some more spaces.

It might be helpful for those who want to learn WxPerl, especially that there is so little documentation for WxPerl. (I've created an executable program and I put it and the source code, and a version with some explanations at:
http://www.tranzactiibursiere.ro/static/FruitBasket_Wx.rar

Here it is:

use strict;
use Wx qw(wxALIGN_RIGHT);
use Wx::Event qw(EVT_BUTTON);

my $frame = Wx::Frame->new(undef, -1, "The app", [-1,-1], [200,150]);

my $panel = Wx::Panel->new($frame, -1);

Wx::StaticText->new($panel, -1, "&Fruit:", [20,20], [30,20], wxALIGN_RIGHT);

my $fruit = Wx::TextCtrl->new($panel, -1, "", [50,20], [100,20]);

my $add = Wx::Button->new($panel, -1, "&Add", [150,20], [50,20]);

$add->SetDefault;

Wx::StaticText->new($panel, -1, "F&ruits:", [20,60], [30,20], wxALIGN_RIGHT);

my $list = Wx::ListBox->new($panel, -1, [50,60], [100,100]);

my $del = Wx::Button->new($panel, -1, "&Delete", [150,60], [50,20]);

EVT_BUTTON($frame, $add, \&add);
EVT_BUTTON($frame, $del, \&del);

$frame->Show(1);
Wx::SimpleApp->new->MainLoop;

sub add {
my $current_fruit = $fruit->GetValue;

if (defined $current_fruit) {
$list->Append($current_fruit);
$fruit->Clear;
}
}

sub del {
my $index = $list->GetSelection;
$list->Delete($index) if $index >= 0;
}



Octavian

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind



__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: