-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00944c5
commit 045a38b
Showing
14 changed files
with
496 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{cr,yml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[Makefile] | ||
indent_style = tab | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/bin/ | ||
/doc/ | ||
/libs/ | ||
/lib/ | ||
/.crystal/ | ||
/.shards/ | ||
|
||
# Executable | ||
layout | ||
|
||
# Libraries don't need dependency lock | ||
# Dependencies will be locked in application that uses them | ||
/shard.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
language: crystal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 TamasSzekeres | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
all: | ||
crystal build src/layout.cr --link-flags -L/usr/X11R6/lib/ | ||
|
||
clean: | ||
rm layout | ||
|
||
clear-deps: | ||
rm -rf .shards | ||
rm -rf lib | ||
rm shard.lock | ||
|
||
install: | ||
crystal deps | ||
|
||
reinstall: clear-deps install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# ltk-cr/examples/layout | ||
|
||
Simple example application with using layout. | ||
|
||
## Usage | ||
|
||
Resize the window to view layout working. | ||
|
||
## Contributing | ||
|
||
1. Fork it ( https://github.com/TamasSzekeres/ltk-cr/fork ) | ||
2. Create your feature branch (git checkout -b my-new-feature) | ||
3. Commit your changes (git commit -am 'Add some feature') | ||
4. Push to the branch (git push origin my-new-feature) | ||
5. Create a new Pull Request | ||
|
||
## Contributors | ||
|
||
- [TamasSzekeres](https://github.com/TamasSzekeres) Tamás Szekeres - creator, maintainer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: layout | ||
version: 0.1.0 | ||
|
||
authors: | ||
- Tamás Szekeres <szektam2@gmail.com> | ||
|
||
description: Simple example Window with using layout. | ||
|
||
dependencies: | ||
x11: | ||
path: ../../../x11-cr/. | ||
cairo: | ||
path: ../../../cairo-cr/. | ||
|
||
ltk: | ||
path: ../../. | ||
|
||
targets: | ||
button: | ||
main: src/layout.cr | ||
|
||
crystal: 0.24.1 | ||
|
||
license: MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
require "ltk" | ||
|
||
module Layout | ||
include Ltk | ||
|
||
class Example | ||
# Handling of clicking on the close_button. | ||
def close_button_click | ||
puts "close_button clicked!" | ||
Application.close | ||
end | ||
|
||
def main | ||
# Creating The Main Window. | ||
main_win = MainWindow.new | ||
main_win.title = "Ltk-Win" | ||
main_win.geometry = Rect.new 10, 10, 400, 300 | ||
main_win.margins = Margins.new 20, 20, 20, 20 | ||
|
||
# Creating a PushButton on the Main Window. | ||
one_button = PushButton.new "One", main_win | ||
one_button.object_name = "one_button" | ||
one_button.geometry = Rect.new 20, 20, 150, 23 | ||
one_button.on_click = ->close_button_click | ||
|
||
two_button = PushButton.new "Two", main_win | ||
two_button.object_name = "two_button" | ||
two_button.geometry = Rect.new 20, 60, 150, 23 | ||
two_button.on_click = ->close_button_click | ||
|
||
layout = HorizontalLayout.new nil | ||
layout.add_widget one_button | ||
layout.add_widget two_button | ||
|
||
main_win.layout = layout | ||
|
||
# Runs the application. | ||
Application.run ARGV | ||
end | ||
end | ||
|
||
Example.new.main | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.