Re: [Fxruby-users] More questions...
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <ly...@kn...> - 2004-04-03 17:33:14
|
On Mar 23, 2004, at 7:34 PM, Hal Fulton wrote:
> 1. Given an FXTreeList wherein I add or change an item, how do I get
> the
> tree to redisplay?
If you add an item to a tree list after the program is running, you
should call create() on it to ensure that all of the server-side
resources associated with that tree item are realized. This is
especially important if, for example, you have some special "open" and
"closed" icons for the tree item.
Now, adding an item to the tree list automatically marks its layout
dirty, which means that the layout should be updated during the next
GUI update pass in the event loop. If the change in the layout causes
things to move around, that would also result in a repaint (which is
what I assume you mean by a "redisplay").
One reason that the repaint might get delayed is because you're adding
the tree item(s) inside a callback for some other widget. For example,
suppose you had this code:
addButton.connect(SEL_COMMAND) {
0.upto(10000) { |i|
treeList.addItemLast(null, "item#{i}").create
}
}
Now, while that loop is running (adding the 10,000 new items) the main
event loop is *not* running. And so you wouldn't see the new items
onscreen until this block exits.
> 2. Given an MDIClient where I add or resize an MDIChild, how do I get
> it
> to display?
If you're adding a new MDI child, be sure to call create() on it. If
you're resizing it, I don't know that that marks the layout dirty. Try
calling recalc() on the MDI child after resizing it to see if that
makes a difference.
> 3. Given an MDIChild with a textbox inside it, can I click on the
> window
> frame and select the window without giving focus to the textbox?
Hmmm, maybe, but I think we'll have to subclass FXMDIChild to do so.
Let me investigate and get back to you on that one.
|