RE: [Fxruby-users] FXPopup questions
Status: Inactive
Brought to you by:
lyle
|
From: Oliver S. <ol...@mo...> - 2004-05-17 21:01:37
|
> Thanks for the quick reply!
> [snip]
Oh, I see, after looking through the dialog.rb sample some more. Have you
tried the FXOptionMenu class attributes for setting the currently selected
option? This works for me:
popup = FXPopup.new(self)
thing1 = FXOption.new(popup, "thing 1")
thing2 = FXOption.new(popup, "thing 2")
menu_button = FXOptionMenu.new(self, popup)
menu_button.currentNo = 1 # could also do menu_button.current = thing2
As to removing the children, this also works for me under Win2k:
FXButton.new(self, "click me").connect(SEL_COMMAND) { |sender, message,
data|
popup.children.each { |child| popup.removeChild(child) }
thing3 = FXOption.new(popup, "thing 3")
thing4 = FXOption.new(popup, "thing 4")
thing3.create
thing4.create
# note - the menu text doesn't seem to update itself, so you have to click
# on a new item...don't know what's wrong there
}
After testing, the children.each thing seems to work...I remember it
screwing me up once, but I think that was with a tree list and I may have
been doing something weird. Anyway, I hope this is a little more useful. :)
Sorry if I'm still off-base.
Oliver
|