[fxruby-users] [Foxgui-users] Adding buttons 'on the run' to a FXDialogBox

Damián M. González gonzalezdamianm at hotmail.com
Sat Jun 1 16:35:46 UTC 2013


 I've solved the problem:
 I've seen what the problem is: the dialog doesn't get resized automatically, so the buttons were created but can't see them because the dialog remain the same size as always. The solution was resize the dialog manually, just give it 40 pixels more of height. I don't know if it is desired or no, if the dialog should be automatically resized to contain all the widgets, includes the new created or no. Jeroen knows.  Thanks for the explanation Jeroen.

> Date: Sat, 1 Jun 2013 11:31:40 -0500
> From: jeroen at fox-toolkit.com
> To: gonzalezdamianm at hotmail.com
> CC: foxgui-users at lists.sourceforge.net; fxruby-users at rubyforge.org
> Subject: Re: [Foxgui-users] Adding buttons 'on the run' to a FXDialogBox
> 
> On Sat, 1 Jun 2013 11:09:55 -0300
> Damián M. González <gonzalezdamianm at hotmail.com> wrote:
> 
> >  Hello fellows, I'm working with a FXDialogBox, it have from the beggining a button, if you press that button 2 more buttons should be created in the bottom of the dialog, the problem is that I can't make it appear, I've tried many things: @dialog.create, @dialog.recalc, @dialog.layout, @dialog.update, @dialog.repaint, @dialgo.restore, @dialog.forceRefresh, nothink work. Also I've directly called those method to the buttons and his layout manager, nothing works. What I've noted is that a pixel appear in the upper-right corner of the dialog(inside it), don't know what's happening. Is there any advice that you can give me to solve this? Thanks. 		 	   		  
> 
> Assuming you've passed the layout options such that the buttons would show up,
> you just need to call .create() on all widgets you construct after the fact.
> [I recommend to see if the buttons would actually show up properly by trying
> to see how things would look if you created them right from the beginning].
> 
> A call to recalc() on the buttons flags them as being in need of layout; you
> typically don't call layout directly.
> 
> The list of things you've tried indicates some things may need clarification:
> 
> .create()	Realizes the widget, i.e. creates a window corresponding to
> 		the C++ data structure that lives only in your program. Until
> 		this is called the system doesn't know about your control.
> 
> .recalc()	Tells the fox library that at the earliest convenience, the
> 		widget tree of which the child is a part needs to be laid out.
> 		This is often called automatically when you change something
> 		about the child that may affect its size (e.g. change the
> 		label on a button).
> 
> .layout()	This is the routine that actually places the children underneath
> 		the layout manager (like FXHorizontalFrame).  This is a recursive
> 		routine that measures all the children and then arranges them
> 		according to some pattern (observing some layout hints in the
> 		children).
> 		The layout() routine is normally called from the top down, like
> 		when a window is resized, or a control somewhere in the widget
> 		tree has recalc() called on it.  Since layout is expensive the
> 		execution is usually delayed until the main thread is about to
> 		block for events.
> 
> .update()	Marks a widget's pixels as "dirty" and in need of repainting. 
> 		Its very cheap because it doesn't actually repaint.
> 
> .repaint()	Processes all outstanding repaint rectangles for the window,
> 		after flushing all commands to X11 server or GDI (Windows).
> 		Only has an affect if there actually are any repaint rectangles.
> 
> 
> .forceRefresh()	Generate SEL_UPDATE messages for all widgets under the widget
> 		tree.  These are GUI Update messages that are used to interrogate
> 		application-state.  This has absolutely nothing to do with layout
> 		at all.
> 
> ==========
> 
> 
> Hope this helps,
> 
> 			-- JVZ
> 		
> 
> 
> 
> 
> -- 
> +----------------------------------------------------------------------------+
> | Copyright (C) 11:10 06/ 1/2013 Jeroen van der Zijp.   All Rights Reserved. |
> +----------------------------------------------------------------------------+
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20130601/d10654b4/attachment.html>


More information about the fxruby-users mailing list