Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to access window property from a command button

7 posts in Objects Last posting was on 2004-01-09 19:41:37.0Z
ANAND Posted on 2004-01-09 11:52:50.0Z
Sender: 7527.3ffe9809.1804289383@sybase.com
From: Anand
Newsgroups: sybase.public.powerbuilder.objects
Subject: How to access window property from a command button
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <3ffe982b.7529.846930886@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 9 Jan 2004 04:01:47 -0800, 10.22.241.42
Lines: 12
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 Jan 2004 03:38:11 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Jan 2004 03:52:50 -0800
X-Trace: forums-1-dub 1073649170 10.22.108.75 (9 Jan 2004 03:52:50 -0800)
X-Original-Trace: 9 Jan 2004 03:52:50 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7730
Article PK: 735003

I have placed a command button in a tabpage of a Tabcontrol
which is placed on a window.Now from the command button I
want to access the window property "Height",I am getting
null object reference erro when I use the window name in the
script.

code used in the button
wm_source_document.height=wm_source_document.height+500

Please provide a solution for this.

Anand


Andy Turiansky [TeamSybase] Posted on 2004-01-09 13:27:48.0Z
From: "Andy Turiansky [TeamSybase]" <aturiansky@comcast.net>
Newsgroups: sybase.public.powerbuilder.objects
Organization: 192.195.217.10
References: <3ffe982b.7529.846930886@sybase.com>
X-Newsreader: AspNNTP 1.50 (Takeshi Eto)
Subject: Re: How to access window property from a command button
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 64.79.161.46
Message-ID: <3ffeae6e$1@forums-2-dub>
X-Original-Trace: 9 Jan 2004 05:36:46 -0800, 64.79.161.46
Lines: 37
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 Jan 2004 05:13:07 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Jan 2004 05:27:48 -0800
X-Trace: forums-1-dub 1073654868 10.22.108.75 (9 Jan 2004 05:27:48 -0800)
X-Original-Trace: 9 Jan 2004 05:27:48 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7731
Article PK: 735005

What version of PB are you running? What type of a window are you dealing with?
I just created a main! window, added a tab control and on this tab control, I
added a cb and added the following code:

w_tab.height = w_tab.height+1000

Worked for me. Please provide more information as to the3 version you are
running, the type of window etc...

On 9 Jan 2004 03:52:50 -0800,
in sybase.public.powerbuilder.objects

<Anand> wrote:
>I have placed a command button in a tabpage of a Tabcontrol
>which is placed on a window.Now from the command button I
>want to access the window property "Height",I am getting
>null object reference erro when I use the window name in the
>script.
>
>code used in the button
>wm_source_document.height=wm_source_document.height+500
>
>Please provide a solution for this.
>
>Anand

- - -
Andy [TeamSybase]

Submit Sybase product enhancement requests via:
http://www.isug.com/cgi-bin/ISUG2/submit_enhancement


Techwave 2003 - http://www.sybase.com/techwave2003
International Sybase User Group (ISUG) - http://www.isug.com
CodeXchange - http://powerbuilder.codeXchange.sybase.com/


dhun_Spamnone_ter Posted on 2004-01-09 15:55:32.0Z
From: dhun_Spamnone_ter@mmm.com
Subject: Re: How to access window property from a command button
Newsgroups: sybase.public.powerbuilder.objects
MIME-Version: 1.0
References: <3ffe982b.7529.846930886@sybase.com>
X-Newsreader: Lotus Notes Release 5.0.9a January 7, 2002
X-MIMETrack: Serialize by Notes Client on Doug Hunter/US-Corporate/3M/US(Release 5.0.9a |January 7, 2002) at 01/09/2004 09:40:45 AM, Serialize complete at 01/09/2004 09:40:45 AM
Content-Type: text/plain; charset="us-ascii"
X-Original-NNTP-Posting-Host: 169.10.78.217
Message-ID: <3ffed109$1@forums-2-dub>
X-Original-Trace: 9 Jan 2004 08:04:25 -0800, 169.10.78.217
Lines: 12
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 Jan 2004 07:40:46 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Jan 2004 07:55:32 -0800
X-Trace: forums-1-dub 1073663732 10.22.108.75 (9 Jan 2004 07:55:32 -0800)
X-Original-Trace: 9 Jan 2004 07:55:32 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7733
Article PK: 735009

Anand,

Well, if my guess is right, the solution is simple.

Never use the window name if you can avoid doing so.

In this instance, just use Parent, like

parent.height = parent.height + 500

because if the window is opened dynamically the window name will not be a
valid reference to anything, but Parent will always work.


Larry Molter Posted on 2004-01-09 17:58:43.0Z
From: "Larry Molter" <lmolter1@tampabay.rr.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <3ffe982b.7529.846930886@sybase.com> <3ffed109$1@forums-2-dub>
Subject: Re: How to access window property from a command button
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 4.21.222.131
X-Original-NNTP-Posting-Host: 4.21.222.131
Message-ID: <3ffeebd3@forums-1-dub>
Date: 9 Jan 2004 09:58:43 -0800
X-Trace: forums-1-dub 1073671123 4.21.222.131 (9 Jan 2004 09:58:43 -0800)
X-Original-Trace: 9 Jan 2004 09:58:43 -0800, 4.21.222.131
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7734
Article PK: 735006

In this case, however, the button is on a tabpage, and so, the parent of the
button will be the tabpage. But your point about using pronouns instead of
the window name is a fundamental one and I think a lot of (especially)
newbie developers aren't aware of what happens during an open() call.

Larry

<dhun_Spamnone_ter@mmm.com> wrote in message news:3ffed109$1@forums-2-dub...
> Anand,
>
> Well, if my guess is right, the solution is simple.
>
> Never use the window name if you can avoid doing so.
>
> In this instance, just use Parent, like
>
> parent.height = parent.height + 500
>
> because if the window is opened dynamically the window name will not be a
> valid reference to anything, but Parent will always work.


dhun_Remove_ter Posted on 2004-01-09 18:47:59.0Z
From: dhun_Remove_ter@mmm.com
Subject: Re: How to access window property from a command button
Newsgroups: sybase.public.powerbuilder.objects
MIME-Version: 1.0
References: <3ffe982b.7529.846930886@sybase.com> <3ffed109$1@forums-2-dub> <3ffeebd3@forums-1-dub>
X-Newsreader: Lotus Notes Release 5.0.9a January 7, 2002
X-MIMETrack: Serialize by Notes Client on Doug Hunter/US-Corporate/3M/US(Release 5.0.9a |January 7, 2002) at 01/09/2004 12:33:15 PM, Serialize complete at 01/09/2004 12:33:15 PM
Content-Type: text/plain; charset="us-ascii"
X-Original-NNTP-Posting-Host: 169.10.78.217
Message-ID: <3ffef978$1@forums-2-dub>
X-Original-Trace: 9 Jan 2004 10:56:56 -0800, 169.10.78.217
Lines: 17
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 Jan 2004 10:33:18 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Jan 2004 10:47:59 -0800
X-Trace: forums-1-dub 1073674079 10.22.108.75 (9 Jan 2004 10:47:59 -0800)
X-Original-Trace: 9 Jan 2004 10:47:59 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7735
Article PK: 735007

Larry, Darn.. missed that. Thanks for the catch.

In that case Anand, what you could do is declare an instance variable of
the type of your window type and in the open event have the statement
to initialize it and then refer to the window using that instance variable
throughout your window.

<instance declarations>
wm_source_document iw_mywindow

<open event>
iw_mywindow = this

<button script>
iw_mywindow.height = iw_mywindow.height + 500


"Tim Wallace" <reply Posted on 2004-01-09 19:41:37.0Z
From: "Tim Wallace" <reply@this_group.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <3ffe982b.7529.846930886@sybase.com>
Subject: Re: How to access window property from a command button
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: mail.pit-magnus.com
X-Original-NNTP-Posting-Host: mail.pit-magnus.com
Message-ID: <3fff03f1$1@forums-1-dub>
Date: 9 Jan 2004 11:41:37 -0800
X-Trace: forums-1-dub 1073677297 206.139.208.13 (9 Jan 2004 11:41:37 -0800)
X-Original-Trace: 9 Jan 2004 11:41:37 -0800, mail.pit-magnus.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7736
Article PK: 735010

I'll bet you're using the variable of the window type to create your window,
huh? All you need to do is put a loop in your button to keep getting
parents until you find one of the window type, then get its height.

quick example in psuedo code:

set parent = parent of button

while typeof( parent ) <> window
set parent = get parent of parent
loop

parent.height = 100

Hope this makes sense

Tim Wallace

<Anand> wrote in message news:3ffe982b.7529.846930886@sybase.com...
> I have placed a command button in a tabpage of a Tabcontrol
> which is placed on a window.Now from the command button I
> want to access the window property "Height",I am getting
> null object reference erro when I use the window name in the
> script.
>
> code used in the button
> wm_source_document.height=wm_source_document.height+500
>
> Please provide a solution for this.
>
> Anand


bede Posted on 2004-01-09 13:50:59.0Z
From: "bede" <bede@nospam.sofico.be>
Newsgroups: sybase.public.powerbuilder.objects
References: <3ffe982b.7529.846930886@sybase.com>
Subject: Re: How to access window property from a command button
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
Message-ID: <3ffeb3dc$1@forums-2-dub>
X-Original-Trace: 9 Jan 2004 05:59:56 -0800, uu194-7-38-226.unknown.uunet.be
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 Jan 2004 05:36:17 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Jan 2004 05:50:59 -0800
X-Trace: forums-1-dub 1073656259 10.22.108.75 (9 Jan 2004 05:50:59 -0800)
X-Original-Trace: 9 Jan 2004 05:50:59 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7732
Article PK: 735011

isn't this already answered in the other group?

<Anand> wrote in message news:3ffe982b.7529.846930886@sybase.com...
> I have placed a command button in a tabpage of a Tabcontrol
> which is placed on a window.Now from the command button I
> want to access the window property "Height",I am getting
> null object reference erro when I use the window name in the
> script.
>
> code used in the button
> wm_source_document.height=wm_source_document.height+500
>
> Please provide a solution for this.
>
> Anand