Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

The value of a program is proportional to the weight of its output.


programming / comp.lang.smalltalk.dolphin / Re: change menuitem text?

SubjectAuthor
* change menuitem text?john c
`- Re: change menuitem text?klausk

1
Subject: change menuitem text?
From: john c
Newsgroups: comp.lang.smalltalk.dolphin
Date: Fri, 10 Apr 2020 15:41 UTC
X-Received: by 2002:ac8:4757:: with SMTP id k23mr1165288qtp.206.1586533303645;
Fri, 10 Apr 2020 08:41:43 -0700 (PDT)
X-Received: by 2002:a25:aa53:: with SMTP id s77mr8513485ybi.244.1586533303328;
Fri, 10 Apr 2020 08:41:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder7.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Fri, 10 Apr 2020 08:41:43 -0700 (PDT)
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=71.234.62.46; posting-account=FxwEXgoAAADcSnrOjqy8Iwckyp5OTz8K
NNTP-Posting-Host: 71.234.62.46
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5e4859e0-52b0-4816-877c-3d7cca2a8c2e@googlegroups.com>
Subject: change menuitem text?
From: jndbusin...@gmail.com (john c)
Injection-Date: Fri, 10 Apr 2020 15:41:43 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
View all headers
hi all,

i have a tab application. i would like to change one of the menubar items text when a tab change occurs. i have already overridden #onTabChanged:. in #onTabChanged: i have put the following development code in #onTabChanged: but it doesn't change the menubar item text.

any ideas what i'm missing?

john

jcView := self view.
jcMenuBar := jcView menuBar.
jcItems := jcMenuBar items.
jcMenuItem := jcItems at: 2.
id := jcMenuItem id.
jcMenuItem updateItem: 2 id: id text: 'Test'.
jcView refreshContents.
self halt.


Subject: Re: change menuitem text?
From: klausk
Newsgroups: comp.lang.smalltalk.dolphin
Date: Sat, 11 Apr 2020 06:16 UTC
References: 1
X-Received: by 2002:a05:620a:127c:: with SMTP id b28mr7393379qkl.317.1586585809234;
Fri, 10 Apr 2020 23:16:49 -0700 (PDT)
X-Received: by 2002:a25:bc84:: with SMTP id e4mr12478866ybk.381.1586585809037;
Fri, 10 Apr 2020 23:16:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder7.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Fri, 10 Apr 2020 23:16:48 -0700 (PDT)
In-Reply-To: <5e4859e0-52b0-4816-877c-3d7cca2a8c2e@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=130.180.75.154; posting-account=eeVE7woAAAA17wjkt77cEPyKNctBN3jP
NNTP-Posting-Host: 130.180.75.154
References: <5e4859e0-52b0-4816-877c-3d7cca2a8c2e@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ee26ceea-9bc9-4b6f-bbb2-702409c2d894@googlegroups.com>
Subject: Re: change menuitem text?
From: inf...@kirchhoff-edv.de (klausk)
Injection-Date: Sat, 11 Apr 2020 06:16:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
View all headers
Am Freitag, 10. April 2020 17:41:44 UTC+2 schrieb john c:
hi all,

i have a tab application. i would like to change one of the menubar items text when a tab change occurs. i have already overridden #onTabChanged:. in #onTabChanged: i have put the following development code in #onTabChanged: but it doesn't change the menubar item text.

any ideas what i'm missing?

john

jcView := self view.
jcMenuBar := jcView menuBar.
jcItems := jcMenuBar items.
jcMenuItem := jcItems at: 2.
id := jcMenuItem id.
jcMenuItem updateItem: 2 id: id text: 'Test'.
jcView refreshContents.
self halt.

Please take a look at MVP in general.
Your solution will be implementing the menuitems "CommandDescription->command" in the standard method "queryCommand:" of your Presenter (Dialog).
E.g.

(#(jcMenuItemCommand) includes: aCommandQuery command) ifTrue:
[
^aCommandQuery isEnabled: (self conditionForEnabled)
].

This method is called frequently and checks for every command (MenuItem, Pushbutton, etc.).

Cheers,
Klaus

P.S. stay well


1
rocksolid light 0.7.2
clearneti2ptor