You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello,
I like the Idea of having a lua newt binding library :)
I am trying to add function WinMessage()
staticintL_WinMessage( lua_State*L ) {
constchar*title;
constchar*buttonText;
constchar*text;
/*int result;*/unsignedintwidth;
unsignedintheight=1;
unsignedintcols=20;
unsignedintresult;
/* Check if they are Strings if yes, return them..*/title=luaL_checkstring( L, 1 );
buttonText=luaL_checkstring( L, 2 );
text=luaL_checkstring( L, 3 );
lua_pop( L, 3 );
width=strlen( title );
if( strlen( buttonText ) >width )
width=strlen( buttonText );
if( strlen( text ) >width )
width=strlen( text );
height= ( width%cols!=0 ) ? ( ( width/cols ) +1 ) : ( width/cols );
result=newtCenteredWindow( width, height, title );
if( ! result ){
/* add form, with a label inside and a button at the end..*/lua_pushnil( L );
return1;
}else{
lua_pushboolean( L, result );
}
return1;
}
The problem I know almost nothing about newt Library :(
I am stuck there..
It seems by the 3 examples that maybe I will need a form to put a label inside, and a button at the end..?
I can't write a string to root of Window directly or something close?
Thanks in Advance,
Best Regards,
tux
The text was updated successfully, but these errors were encountered:
hello,
I like the Idea of having a lua newt binding library :)
I am trying to add function WinMessage()
The problem I know almost nothing about newt Library :(
I am stuck there..
It seems by the 3 examples that maybe I will need a form to put a label inside, and a button at the end..?
I can't write a string to root of Window directly or something close?
Thanks in Advance,
Best Regards,
tux
The text was updated successfully, but these errors were encountered: