일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Apache
- PANDAS
- Kotlin
- Excel
- GIT
- Python
- string
- Google Excel
- Mac
- SQL
- list
- PySpark
- math
- 파이썬
- google apps script
- numpy
- c#
- array
- PostgreSQL
- django
- hive
- Tkinter
- Github
- Java
- dataframe
- gas
- Redshift
- Google Spreadsheet
- matplotlib
- Today
- Total
목록button (5)
달나라 노트

버튼은 클릭을 할 수 있으며 클릭을 할 때 어떤 기능을 하도록 할 수 있습니다. 일단 먼저 Window에 버튼을 띄워봅시다. import tkinter as tk window = tk.Tk() window.geometry('500x400') button = tk.Button(window, text='click') button.place(x=0, y=0) window.mainloop() - button = tk.Button(window, text='click') 먼저 Button 객체를 생성합니다. text는 버튼에 표시할 텍스트를 의미합니다. - button.place(x=0, y=0) 버튼이 Window에 표시될 위치를 지정합니다. 일단 이 코드에서 알 수 있는 것이 하나 있습니다. Button cla..

Window에 사용할 수 있는 Button을 생성해봅시다. 아래 코드를 실행시켜봅시다. using System; using System.Windows.Forms; class MyProgram { public static void Main() { Form fm = new Form(); fm.Width = 500; fm.Height = 300; Button btn = new Button(); btn.Parent = fm; btn.Text = "Sample Button"; btn.Width = 100; btn.Height = 30; Application.Run(fm); } } 그러면 위같은 화면이 뜹니다. 버튼이 Window에 생성되었고, 버튼에 Sample Button이라는 텍스트가 떠있는걸 볼 수 있죠. ..

마우스 클릭, 마우스의 위치 변화, 키보드 입력 등 사용자로부터 발생한 어떠한 변화를 이벤트(Event)라고 합니다. C#에서는 "Event가 발생하면 무엇을 해라" 라는 기능을 구현할 수 있습니다. 아래 코드를 봅시다. using System; using System.Windows.Forms; class MyProgram { public static void Main() { Form fm = new Form(); fm.Text = "Sample Window"; fm.Width = 300; fm.Height = 200; Label lbl = new Label(); lbl.Text = "Welcome!"; lbl.Parent = fm; Application.Run(fm); } } 코드를 실행하면 위 이미지..
이번엔 버튼을 누르면 TextView의 글자가 바뀌도록 해봅시다. activity_main.xml MainActivity.kt package com.example.diceroller import android.os.Bundle import android.widget.Button import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import com.example.diceroller.databinding.ActivityMainBinding class MainActivity : AppCompatActivity() { lateinit var binding: ActivityMainBinding override fun onC..