discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Renaissance menus on OS X ?


From: Helge Hess
Subject: Re: Renaissance menus on OS X ?
Date: Tue, 07 Jan 2003 14:52:54 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212

Nicola Pero wrote:
Yes - we probably want to have something similar, and all the other stuff
with conditionals, repetitions etc.  Maybe as an extension or as a
preprocessing ?

When the .gsmarkup is read, it would first be preprocessed to process the
var:xxx, generating (internally and invisibly) a plain .gsmarkup which
would be processed in the usual way by the existing code.  This just for
simplicity -- we can merge the two processes together at a later stage
when things are clearer, and the design more definitive.

I'm not sure about this yet, we have two options:
a) like in WO, repetitions, conditions etc are real views
b) preprocessing

Both have advantages. Eg with a) you can do a "[myRep reload]" (or bind the repetition using an association) and the subviews would be recreated. If we do b) we can only recreate everything. Also a) is the "WO-way" (WORepetitions are real "renderer" objects with no representation).

I would suggest using "<img src=.../>" and adding a NSURL subclass for resources (eg gsresource://mainbundle/GNUstep.gif). The src would need to be relative to the document (gsresource://mainbundle/MyPage.gsmodel) and we could use "img src="GNUstep.gif".
Easy todo with NSURL.

<image name="MyImage" /> will use [NSImage imageNamed: @"MyImage"] as the
image to display.  That seems the obvious way to start to me: usually when
you write an application you just put MyImage.png in your application main
bundle, and [NSImage imageNamed: @"MyImage"] will found it from there
automatically.

My approach would work exactly the same way for the simple case (since the name would be relative to the document source), but would be much more powerful when getting images from somewhere else.

IMHO the user designing the gsmodel file shouldn't be required to know how an NSImage object is instantiated.

I suppose using a custom URL format to specify where to find resources
might be a quite interesting extension.  I suppose that would allow you to
choose the bundle/framework you want to get the resource from, for example
?

Yes, exactly.

As you say, I suppose we could add a src="..." attribute with a custom
NSURL as something more advanced than name="..." - we can have both
name="..." and src="...".  I like src="..." :-) but probably need to think
a bit about how to design this URL format and have it work.

No. If you load the gsmodel from the bundle, the gsmodel get's assigned it's "base-URL" automagically, eg:

  resource://MyBundle.app/MyPanel.gsmodel

now we allow relative URLs *inside* the XML file, eg:

  <img src="MyImage.gif"/>

this would be expanded to:

  resource://MyBundle.app/MyImage.gif

The "name" attribute would be useless since it is already covered by using a relative "src" value ?

I probably need to prepare a list of ideas :-) I can't implement
everything immediately, and I want to think and discuss a bit before doing
things (to get them right), but I don't want to loose/forget them in the
process.  I think I'll add an IDEAS file to Renaissance.

I still plan to make a demo of my ideas (maybe I get something ready to FOSDEM). The basic thing I need for my ideas is a working autolayout boxes (and of course I have to understand them ;-)

<window class="MyWindow" title="Hello" width="200" height="4000">
 <!-- some views here -->
</window>

"class" should be used for CSS ;-) But besides that, yes, IMHO this would be correct (MyWindow class used in a window "mapping" context).

Do you have another suggestion, instead of calling the attribute 'class' ? It's very intuitive as a name for the attribute.

If we would have a binding file like I explained in the other (private ;-) mail, we could place the class definition there, eg:

.gsmodel
  <window id="win1">...

.wod
  win1: MyWindow {
    target = "#self";
    ... more bindings ...
  }

This is how things are done in WO, just the layout in .html, all the connect things in the .wod.

I like the idea of CSS, but giving it a serious thought, I'm not sure it's
actually relevant.  Can you imagine a really useful example ?  I'm frankly
not sure I can, and the system is so much simpler without them.

CSS is extremly powerful, eg all the theming in Moz is done using CSS. But it's also quite difficult to implement and at least for now I would leave it out of R.

Greetings
  Helge





reply via email to

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