Blob Blame History Raw
<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" type="topic" style="task" id="tour-gjs" xml:lang="ko">

  <info>
    <link type="next" xref="tour-events"/>
    <revision version="0.1" date="2013-06-17" status="stub"/>

    <credit type="author copyright">
      <name>Ekaterina Gerasimova</name>
      <email its:translate="no">kittykat3756@gmail.com</email>
      <years>2013</years>
    </credit>
    <credit type="author copyright">
      <name>Gordon Hill</name>
      <email its:translate="no">caseyweederman@gmail.com</email>
      <years>2013</years>
    </credit>

    <include xmlns="http://www.w3.org/2001/XInclude" href="cc-by-sa-3-0.xml"/>

    <desc>스크립트 실행에 필요한 바인딩을 넣습니다.</desc>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>조성호</mal:name>
      <mal:email>shcho@gnome.org</mal:email>
      <mal:years>2016, 2017.</mal:years>
    </mal:credit>
  </info>

  <title>gjs와 gtk</title>
  <links type="prevnext" style="top"/>
  <links type="series" style="floatend">
    <title>그놈 시작하기</title>
  </links>

  <p><link href="https://wiki.gnome.org/Projects/Gjs">gjs</link>는 그놈 자바스크립트 바인딩이며 gtk를 다룰 때 활용할 수 있습니다. <link href="http://www.gtk.org/">gtk</link>는 그래픽 사용자 인터페이스를 만드는 툴킷입니다.</p> <p>텍스트 편집기를 열어 코드 몇 줄을 붙여넣으십시오. 완전한 스크립트는 <link xref="tour-summary">요약</link>에 있습니다.</p> <p><code>class</code>로 <code>object</code>를 만들고 <code>run()</code> 메서드를 호출하십시오:</p> <example>
  <p>gjs 자바스크립트 바인딩을 호출하십시오. 이 부분은 셸에 gjs로 스크립트를 실행하라고 지시합니다.</p>

  <code>
#!/usr/bin/gjs
</code>

  <p>Import <code>gi.Gtk</code> for <code>Gtk</code> functions. As both
  version 3.0 and 4.0 may be installed, make sure that the desired version
  is imported first.</p>

  <code><![CDATA[
imports.gi.versions.Gtk = '3.0';
const Gtk = imports.gi.Gtk;
]]></code>
</example>
  <links type="prevnext"/>
</page>