Friday, July 20, 2018

#1 2002-12-13 08:03:08 am

julifos
Administrator
From:: Malasaña, Madrid
Registered: 2002-11-20
Posts: 2014

set contents of popup button on-the-fly (DONE!)

Here, the solution:

Applescript:

make new menu item at the end of menu items of menu of popup button "Rachmaninov" of window "Roll-over, Beethoven" with properties {title:"alehop!", enabled:true}

roughy!
Below, the original question:
__________________________________
I'm starting at ASStudio, so I guess I'm going to spam this section a bit... roll

My question (as allways: how to acces15{perties) this time is "how to set the contents of a popup button when the main window is launched". My code just now is:

Applescript:

on will open theObject
set x to {"a", "b", "c"}
--set contents of popup button "FirstPullDown" of theObject to x
end will open

And, as expected, the commented line doesn't work...
Also, I'd like provide a "default selected *menu item*"...
I tried

Applescript:

make new menu item at end of popup button "PulldownOS" of theObject with properties {title:"kapullillo", enabled:true}

It generates an extra *menu item*, but it is disabled and throws and additional error "NSInternalScriptError"... Also, I'd like *delete* the default items "item 1", "item 2", "item 3"...
Perhaps I'm so accustomed to DD's syntax  :cry: ...

Offline

 

#2 2002-12-26 04:51:51 am

Jean-Baptiste LE STANG
Member
From:: Paris
Registered: 2002-11-20
Posts: 167

Re: set contents of popup button on-the-fly (DONE!)

I've foubd the solution to your frist problem. Just use the following i the 'awake from nib' handler

Applescript:

delete menu items of menu of popup button "pp1" of window of theObject


--
Jean-Baptiste LE STANG

Offline

 

#3 2002-12-26 05:30:09 am

Jean-Baptiste LE STANG
Member
From:: Paris
Registered: 2002-11-20
Posts: 167

Re: set contents of popup button on-the-fly (DONE!)

by the way, there is a quicker way to do it.  Clik on "item 1" and delete it :=)) in IB

(looking for separator menu items now …)


--
Jean-Baptiste LE STANG

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)