通缉:Rikulo UXL示例 [英] Wanted: Rikulo UXL example(s)

查看:120
本文介绍了通缉:Rikulo UXL示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要使用Dart编辑器来处理一些UXL。恐怕我感觉到 UXL概述上的示例代码是过时的或缺少一些关键的步骤,让它执行。 (另见:什么是Rikulo dart真的吗?,它将人们引导到博客) 。



我想加快对Dart环境的UXL标记。





似乎可能不是'只是我我发现这些例子令人困惑。 UXL标记是abc.UXL还是abc.uxl.XML文件?现在我在看看Rikulo,因为我把它看作是我喜欢看的非常有用的框架。

这说,请说 rikulo 的人,提供三四个例子一些调整和一点思想。



我会把同样的东西放在其他人想要的工具和框架。 示例教学。并确保你的例子总是工作。

解决方案



p> AFAIK,文档中的所有示例均可正常工作。



您可以将其命名为 .uxl .uxl.xml ,但如果您的编辑器支持XML,我建议使用 .uxl.xml 。否则,您必须将其配置为识别 .xul


关键步骤 更好地提供更具体的问题。







Will] ...



我对ScrollView示例做了一个小小的补充,保存在UXL项目的GitHub上。



ScrollView.uxl.xml



 <! -  ScrollViewTemplate  - > 
<?dart
ScrollViewDemo的一部分;
?>

< Template name =ScrollViewTemplateargs =rows:30,cols:30>
< ScrollView class =scroll-view
profile =location:center center; width:80%; height:80%>
< Apply forEach =r = 0; r< rows; ++ r>
< Apply forEach =c = 0; c< cols; ++ c>
< View style =border:1px solid#553;
background-color:$ {CssUtil.color(250 - r * 4,250 - c * 4,200)}
left =$ {r * 50 + 2}top =$ {c * 50 + 2}
width =$ {46}height =$ {46}>
($ {r},$ {c})
< / View>
< / Apply>
< / Apply>
< / ScrollView>
< / Template>



build.dart



  // import'package:polymer / builder.dart'; 
import'package:rikulo_uxl / uc.dart';

void main(List< String> args){
build(args);
}

这与GitHub示例有什么不同?


  1. 这包括 build .dart文件

  2. 每个单元格都显示其坐标。这显示了两件事。


    • 如何在UXL标记内使用UXL值

    • <
    • 此演示在Dart编辑器上运行下载
    • ul>
    • Dart编辑器版本1.3.0.dev_06_01(DEV)

    • Dart SDK版本1.3.0-dev.6.1

    • 此示例不适用于6.0版本


指出对我来说,似乎不寻常的是需要下载UXL项目来找到一个演示。我需要澄清一个演示可能对我,因为我下载的代码不是一个只是展示一个或三个UXL功能的例子。



我明白人们很忙,东西。在我看来,测试,集成,文档和示例使得80%的项目成为另外20%的代码。其他人有不同的意见。 (


(如果你已经超过5年的话,

I want to get some UXL working with the Dart Editor. I'm afraid that I feel the sample code on UXL Overview is either out of date or lacks some critical steps to let it perform. (See also: What is Rikulo dart really?, which directs people to the blogs).

I want to get up to speed with something like the UXL mark-up for the Dart environment. So are the only examples I've found are on the blog/documentation and the seem to be incomplete.

And it seems like it may not be 'just me' I find the examples confusing. Is a UXL mark-up a 'abc.UXL' or 'abc.uxl.XML' file? For now I'm looking at Rikulo because I see it as the kind of extremely helpful framework I like to see.

That said, please people, provide three or four examples that work with a few tweaks and a bit of thought.

I'll put that same thing out there for others wanting doing tools and frameworks. Examples teach. And make sure your examples always work. Make them part of your unit testing.

Cheers, Will.

解决方案

AFAIK, all samples in the document shall work fine. If we changed spec, we will update the document accordingly.

You can name it .uxl or .uxl.xml, but I'd suggest .uxl.xml if your editor supports XML. Otherwise, you have to configure it to recognize .xul.

Not sure what critical steps you mean or expect. Better to provide a more specific question.


A helpful example [ed. Will] ...

I made a small addition to the ScrollView example that is saved on GitHub for the UXL project.

ScrollView.uxl.xml

<!-- ScrollViewTemplate -->
<?dart
part of ScrollViewDemo;
?>

<Template name="ScrollViewTemplate" args="rows: 30, cols: 30">
  <ScrollView class="scroll-view"
  profile="location: center center; width: 80%; height: 80%">
    <Apply forEach="r = 0; r < rows; ++r">
      <Apply forEach="c = 0; c < cols; ++c">
        <View style="border: 1px solid #553; 
              background-color: ${CssUtil.color(250 - r * 4, 250 - c * 4, 200)}"
              left="${r * 50 + 2}" top="${c * 50 + 2}"
              width="${46}" height="${46}">
         ( ${r}, ${c} )
        </View>
      </Apply>
    </Apply>
  </ScrollView>
</Template>

build.dart

//import 'package:polymer/builder.dart';
import 'package:rikulo_uxl/uc.dart';

void main(List<String> args) {
    build( args );
}

What makes this different from the GitHub example?

  1. This includes the build.dart file
  2. Each cell shows its coordinates. That shows two things.
    • How to use UXL values inside the UXL mark-up and
    • In the runtime it shows you how the scrolling works with the cells
  3. This demo runs on Dart Editor download
    • Dart Editor version 1.3.0.dev_06_01 (DEV)
    • Dart SDK version 1.3.0-dev.6.1
    • The sample didn't work with the 6.0 version

I would also point out that for me, it seems unusual to need to download the UXL project to find one demo. And I need to clarify what a 'demo' might be to "me" as the code I downloaded wasn't an example of anything it just demonstrated one or three UXL features.

I understand people are busy and stuff. And still, in my opinion testing, integration, documentation and examples make 80% of a project the other 20% being code. Others have different opinions. (I think the proportions will be congruent if you have done this for more than 5 years though. Just guessing.)

这篇关于通缉:Rikulo UXL示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆