Steve_BZ has asked for the wisdom of the Perl Monks concerning the following question:

Hi People,

I'm using wxPerl and I'm trying to remove the title bar buttons (max, min close etc) from a dialog box, which works in Windows, but not in Kubuntu 9.10, where I'm left with the system menu, a minimise and a button that doesn't appear to do anything. What am I doing wrong?

Regards

Steve

Here's the code generated by wxGlade:

#!/usr/bin/perl -w -- # generated by wxGlade 0.6.3 on Thu Mar 18 16:21:54 2010 # To get wxPerl visit http://wxPerl.sourceforge.net/ use Wx 0.15 qw[:allclasses]; use strict; package MyDialog; use Wx qw[:everything]; use base qw(Wx::Dialog); use strict; sub new { my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_ +; $parent = undef unless defined $parent; $id = -1 unless defined $id; $title = "" unless defined $title; $pos = wxDefaultPosition unless defined $pos; $size = wxDefaultSize unless defined $size; $name = "" unless defined $name; # begin wxGlade: MyDialog::new $style = wxCAPTION unless defined $style; $self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $sty +le, $name ); $self->__set_properties(); $self->__do_layout(); # end wxGlade return $self; } sub __set_properties { my $self = shift; # begin wxGlade: MyDialog::__set_properties $self->SetTitle("dialog_1"); # end wxGlade } sub __do_layout { my $self = shift; # begin wxGlade: MyDialog::__do_layout $self->Layout(); # end wxGlade } # end of class MyDialog 1; 1; package main; unless(caller){ local *Wx::App::OnInit = sub{1}; my $app = Wx::App->new(); Wx::InitAllImageHandlers(); my $dialog_1 = MyDialog->new(); $app->SetTopWindow($dialog_1); $dialog_1->Show(1); $app->MainLoop(); }
  • Comment on wxPerl - Removing title bar buttons from dialog box doesn't work in Kubuntu 9.10
  • Download Code

Replies are listed 'Best First'.
Re: wxPerl - Removing title bar buttons from dialog box doesn't work in Kubuntu 9.10
by Anonymous Monk on Mar 19, 2010 at 01:24 UTC
    Which version of wxPerl/wxWidgets?
    $ perl -MWx -le"print for Wx->VERSION, Wx->wxVERSION_STRING" 0.96 wxWidgets 2.8.10
    What does warn $style; print? I get 536870912.

    Try

    • $style = wxCAPTION() &~( wxMINIMIZE_BOX() | wxMAXIMIZE_BOX() | wxRES +IZE_BORDER() )
    • use base qw(Wx::Frame);
    • generate c++ or python source
    If the c++ version exibits the same behaviour, the bug might either 1) be a real wxWidgets bug 2) be a limitation of wxWidgets on kde...

      Hi Anon,

      Thanks for all of that. Here are the answers:

      steve@steve-desktop:~$ perl -MWx -le"print for Wx->VERSION, Wx->wxVERS +ION_STRING" 0.91 wxWidgets 2.8.9

      I was *so* impressed by your next idea,

      $style = wxCAPTION() &~( wxMINIMIZE_BOX() | wxMAXIMIZE_BOX() | wxRES +IZE_BORDER() )

      Sadly it didn't work.

      Nor did use base qw(Wx::Frame);

      I also get 536870912.

      Even the totally blank dialog, which works on Windows doesn't work on Kubuntu.

      Thanks for the ideas, any others would be welcome.

      Regards

      Steve

        Thanks for the ideas, any others would be welcome.

        How about you try the real important one ie the c++ version? I doubt its wxperl specific.