Skip to content

Commit

Permalink
added ability for lua scripts to display messages via the Status tab …
Browse files Browse the repository at this point in the history
…of the Messages window.
  • Loading branch information
olsonpm committed Jan 14, 2015
1 parent 516d4d6 commit 24684c9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
15 changes: 15 additions & 0 deletions geanylua/docs/geanylua-ref.html
Expand Up @@ -181,6 +181,11 @@
<td class="desc">-- Send a GTK signal to a Geany interface widget.</td>
</tr>

<tr class="odd">
<td>&nbsp; function <a href="#status"><b>status</b></a> ( message )<br></td>
<td class="desc">-- Send a string to display in the status tab of the messages window.</td>
</tr>

<tr class="even">
<td>&nbsp; function <a href="#text"><b>text</b></a> ( [content] )<br></td>
<td class="desc">-- Get or set the contents of the entire document.</td>
Expand Down Expand Up @@ -967,6 +972,16 @@
</p><br><br>


<a name="status"></a><hr><h3><tt>geany.status ( message )</tt></h3>
<p>
Sends a message to the status tab of the messages window.
</p><p>
The <tt>message</tt> argument is the string to be displayed.
</p><p>
This function's purpose is to provide a user-friendly way to display messages without using the dialog popup.
</p><p>
This function does not return a value.</p><br><br>


<a name="text"></a><hr><h3><tt>geany.text ( [content] )</tt></h3><p>
When called with no arguments, returns the entire text of the currently
Expand Down
10 changes: 10 additions & 0 deletions geanylua/glspi_app.c
Expand Up @@ -282,6 +282,15 @@ static gint dirlist_closure(lua_State *L)
}


static gint glspi_status(lua_State* L)
{
const gchar *string = lua_tostring(L,1);

msgwin_status_add("%s", string);

return 0;
}


static gint glspi_dirlist(lua_State* L)
{
Expand Down Expand Up @@ -599,6 +608,7 @@ static const struct luaL_reg glspi_app_funcs[] = {
{"xsel", glspi_xsel},
{"signal", glspi_signal},
{"stat", glspi_stat},
{"status", glspi_status},
{"basename", glspi_basename},
{"dirname", glspi_dirname},
{"fullpath", glspi_fullpath},
Expand Down
2 changes: 1 addition & 1 deletion geanylua/keywords.list
Expand Up @@ -7,4 +7,4 @@
word5=0xf0a000;0xffffff;false;false

## Put this in the [keywords] section:
user1=geany.activate geany.appinfo geany.banner geany.basename geany.batch geany.byte geany.caller geany.caret geany.choose geany.close geany.confirm geany.copy geany.count geany.cut geany.dirlist geany.dirname geany.dirsep geany.documents geany.fileinfo geany.filename geany.find geany.fullpath geany.height geany.input geany.keycmd geany.keygrab geany.launch geany.length geany.lines geany.match geany.message geany.navigate geany.newfile geany.open geany.optimize geany.paste geany.pickfile geany.pluginver geany.rectsel geany.rescan geany.rowcol geany.save geany.scintilla geany.script geany.select geany.selection geany.signal geany.stat geany.text geany.timeout geany.wkdir geany.word geany.wordchars geany.xsel geany.yield dialog.checkbox dialog.color dialog.file dialog.font dialog.group dialog.heading dialog.hr dialog.label dialog.new dialog.option dialog.password dialog.radio dialog.run dialog.select dialog.text dialog.textarea keyfile.comment keyfile.data keyfile.groups keyfile.has keyfile.keys keyfile.new keyfile.remove keyfile.value
user1=geany.activate geany.appinfo geany.banner geany.basename geany.batch geany.byte geany.caller geany.caret geany.choose geany.close geany.confirm geany.copy geany.count geany.cut geany.dirlist geany.dirname geany.dirsep geany.documents geany.fileinfo geany.filename geany.find geany.fullpath geany.height geany.input geany.keycmd geany.keygrab geany.launch geany.length geany.lines geany.match geany.message geany.navigate geany.newfile geany.open geany.optimize geany.paste geany.pickfile geany.pluginver geany.rectsel geany.rescan geany.rowcol geany.save geany.scintilla geany.script geany.select geany.selection geany.signal geany.stat geany.status geany.text geany.timeout geany.wkdir geany.word geany.wordchars geany.xsel geany.yield dialog.checkbox dialog.color dialog.file dialog.font dialog.group dialog.heading dialog.hr dialog.label dialog.new dialog.option dialog.password dialog.radio dialog.run dialog.select dialog.text dialog.textarea keyfile.comment keyfile.data keyfile.groups keyfile.has keyfile.keys keyfile.new keyfile.remove keyfile.value

0 comments on commit 24684c9

Please sign in to comment.