Re: Another FruitBasket with Wx

  • From: "inthaneelf" <inthaneelf@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 19 Nov 2007 14:11:52 -0800

hmmm, I got the download no problem, if you wish I can pass it to you.

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: "Jamal Mazrui" <empower@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Monday, November 19, 2007 1:04 PM
Subject: Re: Another FruitBasket with Wx


Hi Octavian,
I just tried downloading the .rar file you posted but am getting a page
not found error.
Jamal
On Sat, 17 Nov 2007, Octavian Rasnita wrote:

Date: Sat, 17 Nov 2007 21:56:28 +0200
From: Octavian Rasnita <orasnita@xxxxxxxxx>
Reply-To: programmingblind@xxxxxxxxxxxxx
To: programmingblind@xxxxxxxxxxxxx
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

Other related posts: