File: basic-dialogs.lua

package info (click to toggle)
geany-plugins 2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,832 kB
  • sloc: ansic: 107,883; sh: 5,567; makefile: 1,531; sed: 16
file content (23 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--[[
  Demo script to test the various dialog functions
--]]

geany.banner="Dialog Test"
while true do
  local s
  s=geany.input("Please enter your name:", "anonymous") 
  if (s) 
    then geany.message( "Hello, " .. s .. "!" ) 
    else geany.message("Cancelled!")
  end
  s=geany.choose("Pick a color:", {"red","orange","yellow","green","blue","purple"})
  if (s) 
    then geany.message( "You picked \"" .. s .. "\"") 
    else geany.message("Nothing selected")
  end
  if not geany.confirm("Loop completed...", "Repeat the demo?", true)
  then 
    geany.message("*** Dialogs Demo ***", "Finished!")
    break
  end
end