[fxruby-users] Show the Button

Uwe Hartl uwe.hartl at gmx.net
Thu Feb 16 16:56:15 EST 2006


Hi, 

thanks for the help. I have one more question for today. 
$created containt the information if the App is created already. I took the 
toolbar code from the imageviewer-example to initialize the toolbar.

If I add another button after the app is created, it does not show up. I have 
to resize the MainWindow to change the size of the toolbar, then it is shown. 
But the button.shown? prints "true". update and show do not show it. What do 
I do wrong? Here is the code:


	def addToolBarButton(icon = nil, text = "Button", &command)
		if (!@toolBarButtons.has_key?(text))
			button = FXButton.new(@toolbar, text, icon) 
			@toolBarButtons[text] = button
			button.connect(SEL_COMMAND) do yield end
			button.create if $created
			button.update
			p button.shown?.to_s
		else
			p "This Toolbar Button did exists already!"
		end
	end

Thanks
Uwe

-- 
***********************************************************************
Uwe Hartl                                e-mail: Uwe.Hartl at gmx.net
91522 Ansbach                            Telephone: (0981) 9724526
Am Mühlfeld 8                            Notfall-Mobil: (0160)90418680
Germany
***********************************************************************




More information about the fxruby-users mailing list