简体   繁体   English

通缉:Rikulo UXL示例

[英]Wanted: Rikulo UXL example(s)

I want to get some UXL working with the Dart Editor. 我想在Dart编辑器中使用一些UXL。 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. 恐怕我觉得UXL Overview上的示例代码已经过时,或者缺少一些关键的步骤来执行它。 (See also: What is Rikulo dart really? , which directs people to the blogs). (另请参见: Rikulo dart到底是什么? ,它使人们进入博客)。

I want to get up to speed with something like the UXL mark-up for the Dart environment. 我想跟上Dart环境的UXL标记之类的速度。 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? UXL标记是“ abc.UXL”或“ abc.uxl.XML”文件吗? For now I'm looking at Rikulo because I see it as the kind of extremely helpful framework I like to see. 现在,我正在研究Rikulo,因为我认为它是我喜欢看到非常有用的框架。

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. AFAIK, 文档中的所有样本都可以正常工作。 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. 您可以将其命名为.uxl.uxl.xml ,但是如果您的编辑器支持XML,我建议使用.uxl.xml Otherwise, you have to configure it to recognize .xul . 否则,您必须将其配置为识别.xul

Not sure what critical steps you mean or expect. 不知道您的意思或期望的关键步骤 Better to provide a more specific question. 最好提供一个更具体的问题。


A helpful example [ed. 一个有用的例子[ed。 Will] ... 威尔]

I made a small addition to the ScrollView example that is saved on GitHub for the UXL project. 我对ScrollView示例做了一点补充,该示例保存在GitHub上用于UXL项目。

ScrollView.uxl.xml 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 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? 是什么与GitHub示例不同?

  1. This includes the build .dart file 这包括构建 .dart文件
  2. Each cell shows its coordinates. 每个单元格显示其坐标。 That shows two things. 这说明了两件事。
    • How to use UXL values inside the UXL mark-up and 如何在UXL标记使用UXL值,以及
    • In the runtime it shows you how the scrolling works with the cells 在运行时中,它向您显示滚动如何与单元格一起工作
  3. This demo runs on Dart Editor download 该演示在Dart编辑器下载上运行
    • Dart Editor version 1.3.0.dev_06_01 (DEV) Dart编辑器版本1.3.0.dev_06_01(DEV)
    • Dart SDK version 1.3.0-dev.6.1 Dart SDK版本1.3.0-dev.6.1
    • The sample didn't work with the 6.0 version 该示例不适用于6.0版本

I would also point out that for me, it seems unusual to need to download the UXL project to find one demo. 我还要指出,对我来说,需要下载UXL项目来查找一个演示似乎很不寻常。 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. 而且我需要澄清一下“演示”对我来说可能是什么,因为我下载的代码并不是任何示例的示例,它仅演示了一个或三个UXL功能。

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. 我仍然认为,测试,集成,文档和示例构成了项目的80%,另外20%是代码。 Others have different opinions. 其他人有不同的意见。 ( I think the proportions will be congruent if you have done this for more than 5 years though. Just guessing. ) 我认为,如果您已经这样做超过5年,比例将是一致的。只是猜测。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM