|
|
RealBasic4: How do I embed a tabpanel in a tabpanel, use popup menus
|
|
|
|
Fresh-Faced Recruit
Join Date: Sep 2001
Status:
Offline
|
|
(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
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Mar 2002
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Sep 2001
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Mar 2002
Status:
Offline
|
|
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 ]
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Sep 2001
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|