Re: Gtk2:Dialog->new



-- Deling Ren <deling_ren 123mail org> wrote
(on Monday, 11 August 2003, 07:08 PM -0700):
Dear all,

I am trying to write an application whose main window is just a dialog. 
I tried to create the dialog using:

my $dialog = Gtk2::Dialog->new ('Hello world', $parent,
               ['destroy-with-parent','modal'],
               'gtk-ok', 'ok',
               'gtk-cancel', 'cancel');

I have no idea what value should I pass as $parent, since this dialog 
has no parent. Any suggestion will be highly appreciated. Thanks.

use 'undef':

my $dialog = Gtk2::Dialog->new ('Hello world', undef,
               ['destroy-with-parent','modal'],
               'gtk-ok', 'ok',
               'gtk-cancel', 'cancel');

I don't know if it's the proper way, but I've used that and it works
fine.

BTW, I have no background in GTK/GTK2/Perl, where shall I start to lean 
gtk2-perl? I didn't find any helpful tutotial to start off with. 

There was a post from Ross McFarland earlier today in which he gave a
link to something he's been working on; search the list archives, and
you should find it. It also has links to the original gtk-perl
tutorials.

Also check out the 'gtk-demo' folder in the distribution, and run
'main.pl' -- you can learn quite a bit by studying the scripts contained
therein.

I have a lot of experience with MS Windows SDK/MFC though. 

Bah! ;-)

Thanks!

-- 
Matthew Weier O'Phinney
http://weierophinney.net/matthew/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]