File: tour-gjs.page

package info (click to toggle)
gnome-devel-docs 40.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 79,188 kB
  • sloc: javascript: 2,514; xml: 2,407; ansic: 2,229; python: 1,854; makefile: 805; sh: 499; cpp: 131
file content (51 lines) | stat: -rw-r--r-- 2,302 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?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, 2018.</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><code>Gtk</code> 함수를 사용할 수 있도록 <code>gi.Gtk</code> 를 임포팅하십시오. 3.0 버전과 4.0 버전 둘 다 설치할 수 있으니 원하는 버전을 가져왔는지 우선 확인하십시오.</p>

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