Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > RealBasic4: How do I embed a tabpanel in a tabpanel, use popup menus

RealBasic4: How do I embed a tabpanel in a tabpanel, use popup menus
Thread Tools
MajorMatt
Fresh-Faced Recruit
Join Date: Sep 2001
Status: Offline
Reply With Quote
Apr 15, 2002, 04:02 PM
 
(I am just making a small app, and I do not need the speed or great power of Cocoa)

Hi:

1. I am making a small app and have run into a few small problems, I am trying to embed a tabpanel in a tabpanel, but my UI elements are showing through all the layers. Also, I can see the tab panel from other than the tab of where its supposed to be. Does anyone have any suggestions?

2. Ok, I give up, how do I use popup menus? Iv been scouring the web but have not been able to find any good examples of how to use one. I just want a selection from a popup menu to activate a formula/insert a value into a field like a button can do.

Thanks to who responds,

-Matt
     
Brooks Seymore
Fresh-Faced Recruit
Join Date: Mar 2002
Status: Offline
Reply With Quote
Apr 15, 2002, 05:07 PM
 
Put a StaticText control and a PopupMenu control on a Window.

For the popup menu, put the following in its open handler:

// fill the popup menu with the name of jazz musicians

popupmenu1.addrow "Mingus, Charles"
popupmenu1.addrow "Monk, Thelonious"
popupmenu1.addrow "Adams, Pepper"

// tell the popup menu to display the first line of its content

popupMenu1.listIndex = 0

Put the following into the Change event of that popup menu:

StaticText1.Caption = PopupMenu1.Text

Now run your project and play around with the popup menu.

Check out the following sites for more REALbasic information:

http://realbasic.zapkerpow.com/cgi-bin/namazu
http://www.realsoftware.com/support/internet.html

As for placing a tab panel on another tab panel, unfortunately it can't be done.

- Brooks
     
MajorMatt  (op)
Fresh-Faced Recruit
Join Date: Sep 2001
Status: Offline
Reply With Quote
Apr 15, 2002, 06:09 PM
 
Thanks a bunch, your explanation has worked perfectly, but I forgot to ask one thing. When I select an item in the menu, I need it to give a value different than what was selected. So:

Black=0
Brown=1
Red=2
Orange=3
Yellow=4
Green=5

-Matt
     
Brooks Seymore
Fresh-Faced Recruit
Join Date: Mar 2002
Status: Offline
Reply With Quote
Apr 15, 2002, 11:43 PM
 
If Red is the third item in your popup menu (which is a zero-based list), you can get what you want by doing this in the Change event:

StaticText1.Caption = str(PopupMenu1.ListIndex)

So, when selected Red in your popup menu, you should see 2 in your StaticText field.

If that doesn't fit your needs, do a search in the Zapkerpow archives (the first link in my post) for the RowTag property, it allows users to assign hidden values to items in a popup menu.

Black = Socks
Green = Leaves
Red = Shirt

I've never needed to use the RowTag property so I can't offer any code. There is a brief sample in the built-in help file.

- Brooks

Originally posted by MajorMatt:

<STRONG>Thanks a bunch, your explanation has worked perfectly, but I forgot to ask one thing. When I select an item in the menu, I need it to give a value different than what was selected. So:

Black=0
Brown=1
Red=2
Orange=3
Yellow=4
Green=5

-Matt</STRONG>
[ 04-15-2002: Message edited by: Brooks Seymore ]
     
MajorMatt  (op)
Fresh-Faced Recruit
Join Date: Sep 2001
Status: Offline
Reply With Quote
May 3, 2002, 02:45 PM
 
Is there no proper way?
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:05 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,