|
|
Choosing A Webhost: |
Re: ListBox in Notebook doesn't accept mouse input: msg#00017lang.perl.wxperl
DH wrote: --- "sky@xxxxxxxxx" <sky@xxxxxxxxx> wrote:I'm assuming the code I submitted in my first message was insufficient, so here is a self-contained wxPerl app which demonstrates the problem. package TestFrame; use strict; use Wx qw(:everything); use base 'Wx::Frame'; use Wx::Event qw(EVT_MENU EVT_BUTTON EVT_LIST_ITEM_ACTIVATED EVT_RADIOBUTTON); sub new { my $class = shift; my $self = $class->SUPER::new(@_); # Create a panel for the whole window or frame $self->{panel} = Wx::Panel->new($self, -1, [0, 0], $self->GetSize()); my ($width, $height) = $self->GetSizeWH(); # Create a 'notebook' (i.e. a set of tabs) $self->{notebook} = Wx::Notebook->new($self->{panel}, -1, [0, 0], [$width, $height - 70]); # Create a panel for active/unsent invoices $self->{panel_unsent} = Wx::Panel->new($self, -1); # Create a panel for sent/archived invoices $self->{panel_sent} = Wx::Panel->new($self, -1); # So they are visible, add these panels to the notebook $self->{notebook}->AddPage($self->{panel_unsent}, "Unsent/active invoices"); $self->{notebook}->AddPage($self->{panel_sent}, "Sent/archived invoices"); # Create an OK button that will be displayed below the notebook/tabs. $self->{button_ok} = Wx::Button->new($self->{panel}, -1, "OK", [ ($width - 60) / 2, $height - 60 ]); # Add items to the unsent/active tab $self->{list_active} = Wx::ListBox->new($self->{panel_unsent}, -1, [5, 5], [200, 370], [1, 2, 3], wxLB_ALWAYS_SB | wxLB_SORT); #$self->{list_active}->Append($_) for (1 .. 100); EVT_BUTTON($self, $self->{button_ok}, sub { $self->Close(1) }); $self->SetIcon(Wx::Icon->new('icircle.ico', wxBITMAP_TYPE_ICO)); return $self; } package TestApp; use strict; use base 'Wx::App'; use Wx qw(:everything); # We must provide an "OnInit" function that specifies what frames # our application will use. sub OnInit { my $self = shift; my $mainFrame = TestFrame->new( undef, # Parent window -1, # Window ID 'Foo', # Window title [5, 5], # X, Y position [600, 480] # X, Y size ); $self->SetTopWindow($mainFrame); # Set the top-level window. $mainFrame->Show(1); # Show the frame. } package main; TestApp->new()->MainLoop; Thanks, Nick ------------------------------------------------------- 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. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Wx::FileSelector feature missing, DH |
|---|---|
| Next by Date: | Re: ListBox in Notebook doesn't accept mouse input, DH |
| Previous by Thread: | Re: ListBox in Notebook doesn't accept mouse input, DH |
| Next by Thread: | Re: ListBox in Notebook doesn't accept mouse input, DH |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |