Skip to content

cesarandreu/jsgtk-examples

 
 

Repository files navigation

jsgtk-examples

JSGtk+ examples showing how to build Gtk JavaScript applications.

All examples were originally based on GJS, here readapted to use part of jsgtk features.

Run

Download this project with:

git clone https://github.com/WebReflection/jsgtk-examples.git

cd jsgtk-examples

Then install jsgtk via npm install -g jsgtk and run the examples with:

jsgtk egAsset

jsgtk egHeader

jsgtk egList

jsgtk egSearch

# ... etc ...

egAsset.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk.Image

egAsset0

egIcon.js

JSGtk+ example showing how to build Gtk javascript applications setting the application icon from the 'assets' folder and if not available from the 'stock icons'

egIcon0 egIcon1

egCss.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk.CssProvider from source code or from loaded .css files

egCss0

egJustify.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk.Label and its justification options

egJustify0

egTimers.js

JSGtk+ example showing how to build Gtk javascript applications emulating setTimeout, clearTimeout, setInterval and clearInterval functions with Mainloop timeout_add. It also shows how to import and use an application library

egTimers0

egEvent.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk.EventBox to catch events for widgets which do not have their own window

egEvent0

egSpawn.js

JSGtk+ example showing how to build Gtk javascript applications executing a non blocking command line call, it uses TextBuffer, TextView, GLib.spawn_async_with_pipes, Gio.UnixInputStream, Gio.DataInputStream and read_line_async

egSpawn0

egInfo.js

JSGtk+ example showing how to build Gtk javascript applications getting information from GLib and command line

egInfo0

egDialog.js

JSGtk+ example showing how to build Gtk javascript applications adding an option to the application's Gio.Menu and opening dialog and modal windows using Gtk.Dialog

egDialog0 egDialog1 egDialog2

egList.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk TreeView and ListStore

egList0

egJSON.js

JSGtk+ example showing how to build Gtk javascript applications reading and writting JSON files

egJSON0

egOpen.js

JSGtk+ example showing how to build Gtk javascript applications with FileChooserDialog with FileFilter, setExtraWidget (ComboBox)

egOpen0 egOpen1

egHeader.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk HeaderBar, and Popover buttons with Gtk Widget or Gio GMenu.

egHeader0 egHeader1

egSearch.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk HeaderBar, SearchBar and a filtered FlowBox

egSearch0

egSelect.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk HeaderBar, SearchBar, ActionBar, a filtered FlowBox, an application library and custom widgets to create a selection mode

egSelect0 egSelect1

egClutter.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk and Clutter, showing how to drag actors with Clutter.DragAction, perform animations with PropertyTransition, TransitionGroup and control the actor from Gtk.Scale

egClutter0

egCairo.js

JSGtk+ example showing how to build Gtk javascript applications using Gtk and Cairo, the left example adds one Cairo actor to Clutter, the example on the right adds one Cairo widget to GTK using GtkClutter.Embed, Gtk.DrawingArea, Cairo.Context, Clutter.Canvas

egCario0

egWebmsg.js

JSGtk+ example showing how to build Gtk javascript applications using WebKit2.WebView, also showing how to send messages from GTK to Webkit and vice versa

egWebmsg0

About

GJS examples showing how to build Gtk javascript applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.5%
  • HTML 1.3%
  • CSS 0.2%