Try this code:

$Hash{style} = WS_CAPTION | WS_SYSMENU;
$WindowHandle = new GUI::DialogBox (
   -name    => $Hash{name},
   -title   => $Hash{title},
   -style   => $Hash{style},
   -left    => $Hash{left},
   -top     => $Hash{top},
   -width   => $Hash{width},
   -height  => $Hash{height},
);


You will find that it works (assuming that all the other hash values are
correct), but the following will not.

$Hash{style} = "WS_CAPTION | WS_SYSMENU";
$WindowHandle = new GUI::DialogBox (
   -name    => $Hash{name},
   -title   => $Hash{title},
   -style   => $Hash{style},
   -left    => $Hash{left},
   -top     => $Hash{top},
   -width   => $Hash{width},
   -height  => $Hash{height},
);


You need to store the style as number or convert it to a number using an
eval as Aldo pointer out.

Sorry if I was short, I did not mean to lecture.

P.S. I have tested this.

Indy Singh
IndigoSTAR Software -- www.indigostar.com


----- Original Message -----
From: Jeremy Blonde <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 13, 2000 3:02 PM
Subject: [perl-win32-gui] Re:


> Your suggestion doesn't work.
>
> Perhaps next time, you could forgo the lecture and
> instead address the question.
>
> Thank you,
> Jeremy Blonde
>
> --- [EMAIL PROTECTED] wrote:
> > The problem is that style is not a string, it is a
> > number.
> >
> > $style = "WS_CAPTION | WS_SYSMENU";
> > is not the same as
> > $style = WS_CAPTION | WS_SYSMENU;
> >
> > The first (incorrect) format is a string, the second
> > is a number.
> >
> > This problem has nothing to do with XML, by throwing
> > it in your question you
> > are  confusing the issue.
> >
> >
> > Indy Singh
> > IndigoSTAR Software -- www.indigostar.com
> >
> >
> > ----- Original Message -----
> > From: Jeremy Blonde <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Monday, July 10, 2000 11:11 PM
> > Subject: [perl-win32-gui] Using XML file for window
> > layout
> >
> >
> > > I'm trying to use an XML file to hold the
> > properties
> > > of the windows in my Perl script.  (No major
> > reason
> > > for this, I just throught it would be a cool way
> > to
> > > learn how to use XML with Perl)
> > >
> > > However, it seems that if I store the window style
> > in
> > > a variable, and try to use the variable to set the
> > > window style, no style is applied to the window
> > when
> > > it is created.  If I hard code the window style,
> > then
> > > it appears correctly.
> > >
> > > Here is the basic layout of the XML file:
> > > <windows>
> > >   <window type="Window Name">
> > >     <property type="name"     value="Window
> > Name"/>
> > >     <property type="icon"     value="Icon"/>
> > >     <property type="version"  value="Version
> > Number"/>
> > >     <property type="modified" value="Modified
> > Date"/>
> > >     <property type="title"    value="Window
> > Title"/>
> > >     <property type="style"    value="Window
> > Styles"/>
> > >     <property type="left"     value="300"/>
> > >     <property type="top"      value="200"/>
> > >     <property type="width"    value="350"/>
> > >     <property type="height"   value="250"/>
> > >   </window>
> > > </windows>
> > >
> > > The value for the Window Styles would be:
> > > "WS_CAPTION | WS_SYSMENU" (or something similar).
> > >
> > > $WindowHandle = new GUI::DialogBox (
> > >   -name    => $Hash{name},
> > >   -title   => $Hash{title},
> > >   -style   => $Hash{style}, # No style is applied
> > >   -style   => WS_CAPTION | WS_SYSMENU, # Works
> > fine
> > >   -left    => $Hash{left},
> > >   -top     => $Hash{top},
> > >   -width   => $Hash{width},
> > >   -height  => $Hash{height},
> > > );
> > >
> > > Is this something that just cannot be done?  Or do
> > I
> > > need to do something differently?  Does anyone
> > have
> > > any suggestions?
> > >
> > > Thanks for your help,
> > > Jeremy Blonde
> > > [EMAIL PROTECTED]
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Get Yahoo! Mail - Free email you can access from
> > anywhere!
> > > http://mail.yahoo.com/
> > >
> >
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Get Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/
>


Reply via email to