discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Renaissance: bad layout with dynamic title


From: Michael Ash
Subject: Renaissance: bad layout with dynamic title
Date: Thu, 27 Mar 2008 15:21:53 -0500
User-agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (FreeBSD/4.11-RELEASE-p20 (i386))

I'm working on a Mac OS X product which I'd like to localize to a bunch of 
different languages. And of course localization is a big pain with nibs, 
so I started investigating other possibilities. I ran into the recent 
releaze of Renaissance 0.9.0 and thought this sounded like a very 
interesting way to solve that problem, so I started experimenting with it.

I've managed to get some things up and running with it, and overall it 
looks very nice and well done. Thanks very much for building this and for 
making it work with Cocoa.

I have run into one problem, however. I want to present a vertical list of 
views, like a table, with each view containing some information. To start 
with I just want each view to contain a single checkbox with a dynamic 
name. I've built an NSView subclass which can live in an NSScrollView, 
built the window for it using Renaissance, and so far so good. Then I 
built a view controller to load a separate gsmarkup file with the layout 
for the individual views. I thought I'd take advantage of Renaissance's 
key-value coding support to program the title dynamically:

<gsmarkup>
    <objects>
        <vbox id="view">
            <button id="mainCheckbox" title="#NSOwner.dictionaryName" 
type="switch"/>
        </vbox>
    </objects>
    <connectors>
        <outlet source="#NSOwner" target="#view" key="view"/>
        <outlet source="#NSOwner" target="#mainCheckbox" 
key="mainCheckbox"/>
    </connectors>
</gsmarkup>

But when I run the program, all of my checkboxes show up as just the 
checkbox, no title.

I've tried many variations on this theme. I've tried setting the title to 
a placeholder, then dynamically updating the title in code (result: 
everything is sized for the original title), I've tried calling 
sizeToFitContent on the vbox and the button (result: no change), removing 
and re-adding the button to its superview (result: no change), I've tried 
using an hbox (no change), an NSBox (naked checkbox in the middle of a 
reasonably wide box), and nothing seems to get the result I want.

It seems like the layout is getting somehow baked into the view hierarchy 
early on, and I need to prod it into updating but I don't know how to do 
that.

One potential complication is that I've compiled the framework using 
-fobjc-gc and I'm hosting it in an application which use garbage 
collection. I'm assuming this is not related to my problem, however if it 
turns out that this is stuff that should Just Work then I'll have to take 
a closer look at what garbage collection may be screwing up. I was also 
using an svn checkout which was a couple of revisions past the 0.9.0 
release, but I've re-tried with the official 0.9.0 source with no change.

Any assistance would be much appreciated.

-- 
Michael Ash
Rogue Amoeba Software


reply via email to

[Prev in Thread] Current Thread [Next in Thread]