SourceForge logo
SourceForge logo
Menu

wxlua-users — wxLua list for users and developers

You can subscribe to this list here.

2005 Jan
Feb
Mar
Apr
May
Jun
(60)
Jul
(35)
Aug
(32)
Sep
(5)
Oct
(5)
Nov
(58)
Dec
(34)
2006 Jan
(114)
Feb
(184)
Mar
(153)
Apr
(90)
May
(153)
Jun
(59)
Jul
(24)
Aug
(43)
Sep
(17)
Oct
(34)
Nov
(11)
Dec
(204)
2007 Jan
(84)
Feb
(119)
Mar
(38)
Apr
(28)
May
(52)
Jun
(105)
Jul
(64)
Aug
(67)
Sep
(14)
Oct
(3)
Nov
(28)
Dec
(55)
2008 Jan
(228)
Feb
(55)
Mar
(30)
Apr
(30)
May
(15)
Jun
(20)
Jul
(12)
Aug
(3)
Sep
(13)
Oct
(54)
Nov
(35)
Dec
(35)
2009 Jan
(19)
Feb
(20)
Mar
(34)
Apr
(4)
May
(60)
Jun
(25)
Jul
(16)
Aug
(51)
Sep
(19)
Oct
(62)
Nov
(21)
Dec
(12)
2010 Jan
(1)
Feb
Mar
(4)
Apr
(12)
May
(23)
Jun
(13)
Jul
(1)
Aug
(40)
Sep
(18)
Oct
(21)
Nov
(26)
Dec
(34)
2011 Jan
(17)
Feb
(23)
Mar
(1)
Apr
(10)
May
(1)
Jun
(5)
Jul
(1)
Aug
Sep
Oct
(2)
Nov
Dec
(43)
2012 Jan
(5)
Feb
(19)
Mar
(6)
Apr
(24)
May
(39)
Jun
(83)
Jul
(29)
Aug
(36)
Sep
(64)
Oct
(55)
Nov
(12)
Dec
(7)
2013 Jan
(17)
Feb
(10)
Mar
(37)
Apr
(27)
May
(13)
Jun
(9)
Jul
(7)
Aug
(61)
Sep
(23)
Oct
(23)
Nov
(30)
Dec
(16)
2014 Jan
(23)
Feb
(13)
Mar
(9)
Apr
(17)
May
(2)
Jun
(11)
Jul
(2)
Aug
Sep
(9)
Oct
(24)
Nov
(2)
Dec
(14)
2015 Jan
(6)
Feb
(4)
Mar
(17)
Apr
May
(7)
Jun
(3)
Jul
Aug
Sep
(2)
Oct
(21)
Nov
(6)
Dec
(2)
2016 Jan
(4)
Feb
(2)
Mar
(7)
Apr
(3)
May
(11)
Jun
(6)
Jul
Aug
(1)
Sep
Oct
Nov
Dec
2017 Jan
Feb
Mar
Apr
(1)
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2018 Jan
(2)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2019 Jan
Feb
Mar
(6)
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
(1)
Oct
Nov
Dec
2022 Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
(2)
Nov
(4)
Dec
2023 Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
(8)
Nov
Dec
2024 Jan
Feb
Mar
Apr
May
Jun
Jul
(2)
Aug
Sep
Oct
Nov
Dec

Showing results of 3998

<< < 1 2 3 4 5 6 .. 160 > >> (Page 4 of 160)
On Wed, Oct 21, 2015 at 5:52 PM, Paul K <pau...@ya...> wrote:
> Hi John,
>
> > I'm still in need of having MacNewFile, MacOpenFiles, and MacReopenApp
> methods (http://docs.wxwidgets.org/trunk/classwx_app.html) and would
> appreciate any update on when you may have chance to add them.
>
> Do you have any update on Mac* methods or any suggestion on how these
> can be added? Maybe you can do one or two of them and I'll use it as
> an example to complete the other methods? It would be good to also add
> MacPrintFile and MacOpenURL as my product now supports file printing
> as well.
>
>
These will require a C++ wxLuaApp class that have its virtual functions
called by wxWidgets and then forward them to an overridden Lua function if
supplied, similar to how printing is implemented.
The problem is that I don't have a Mac so I can't test and this not the
sort of code that can be blindly written with any hope of it working or
even compiling.
> If you are not available to work on this, can you recommend someone
> who can do this or at least to provide some initial implementation.
> Thank you.
>
>
Sorry, I don't know. To be sure, these are basically drag and drop handlers?
Regards,
 John
On Sat, Feb 21, 2015 at 2:52 PM, Paul K <pau...@ya...> wrote:
> > Hi John,
> >
> > I'm still in need of having MacNewFile, MacOpenFiles, and MacReopenApp
> > methods (http://docs.wxwidgets.org/trunk/classwx_app.html) and would
> > appreciate any update on when you may have chance to add them.
> >
> > If you don't have time at all to work on these and other methods, could
> you
> > give me a hint on how these can be added or maybe implement one of them
> and
> > I'll take care of the others? I can add existing methods (like those
> needed
> > for wxSTC or wxTreeCtrl), but it seems like these methods need some sort
> of
> > callback and I don't know how to provide that.
> >
> > Paul.
> >
> >
> > On Thu, Oct 30, 2014 at 11:01 AM, Paul K <pau...@ya...> wrote:
> >>
> >> Hi John,
> >>
> >> >> > I'm looking for a way to provide MacNewFile, MacOpenFiles, and
> >> >> > MacReopenApp methods
> >> >> > (http://docs.wxwidgets.org/trunk/classwx_app.html), but can't
> figure
> >> >> > out how to do this in wxlua and don't see this in any of the
> >> >> > examples.
> >> >>
> >> >> Can these methods be used with the current version of wxlua or do
> they
> >> >> need to be added first?
> >> >
> >> > They need to be added, it should be doable.
> >>
> >> Any plans to add these methods?
> >>
> >> Also, I have a short list of various methods that exist in wxwidgets
> >> 3.x, but are missing from wxlua API:
> >>
> >> wxTopLevelWindow needs EnableFullScreenView
> >> wxTreeCtrl needs GetFocusedItem, SetFocusedItem, ClearFocusedItem
> >> wxSTC needs ScrollRange, ScrollCaret, SetFontQuality, AddStyledText
> >> wxAuiTabArt needs SetColour and SetActiveColour
> >>
> >> If it makes things easier for you, I can probably submit the initial
> >> patch that adds these methods, but AddStyledText seems to be disabled
> >> explicitly, so I'd appreciate if you could check why that's the case.
> >> Thank you.
> >>
> >> Also, it's possible to provide my own wxAuiTabArt provider?
> >>
> >> Paul.
> >
> >
>
From: John L. <jla...@gm...> - 2015年10月23日 03:42:22
On Sun, Oct 18, 2015 at 2:27 PM, Victor Bombi <so...@te...> wrote:
> Hi,
>
> 32*1024 - 7 is the maximum string len that is displayed in wxStyledTextCtrl
> with AppendText.
> I have not seen anywhere information related.
> Is this information in any place?
> Is there any way to get a longer display length?
>
>
Maybe there is an invalid utf8 char at that position that truncates it?
I added this line to the end of the samples/editor.wx.lua LoadFile function
and got all 40000 lines and even tried a larger value without a problem.
function LoadFile(filePath, editor, file_must_exist)
...
 editor:AppendText(string.rep("1234567890\n", 40000))
 return editor
end
Regards,
 John
From: John L. <jla...@gm...> - 2015年10月23日 03:25:09
On Fri, Oct 16, 2015 at 7:42 AM, Z.H. <zo...@ye...> wrote:
> Hi all, wxLua reference manual says the following classes are unavailable:
>
> wxCSConv X Lua uses ANSI 8-bit strings
> wxEncodingConverter X Lua uses ANSI 8-bit strings
> wxMBConv X Lua uses ANSI 8-bit strings
> wxMBConvFile X Lua uses ANSI 8-bit strings
> wxMBConvUTF16 X Lua uses ANSI 8-bit strings
> wxMBConvUTF32 X Lua uses ANSI 8-bit strings
> wxMBConvUTF7 X Lua uses ANSI 8-bit strings
> wxMBConvUTF8 X Lua uses ANSI 8-bit strings
>
> As far as I know, wxLua unicode build will treat all lua strings as utf-8
> strings when converting them from/to wxString's.
> It works fine in most situations. But some applications need to read and
> write files with other encodings
> (see for example the post by Victor Bombi :
> http://sourceforge.net/p/wxlua/mailman/message/33546327/ ).
> In this case, wxEncodingConverter and wxMBConv are neccessary.
>
> Is it possible for wxLua to implement the above classes?
>
The comments about only using ANSI 8-bit strings is slightly misleading in
that they do handle utf-8 as shown in the message you show, but any Lua
string functions will probably not work as expected. This is why I'm not
sure that they would be very useful.
Maybe there is a small subset of the functionality that would suffice for
you and what would that be?
Regards,
 John
From: John L. <jla...@gm...> - 2015年10月23日 03:12:52
On Thu, Sep 3, 2015 at 8:03 AM, Laurent Renoux <lr...@iv...>
wrote:
> Hi John,
>
>
>
> At first, i would like to tell you how big is your works : thanks for all.
>
>
>
> I use wxLua with wxWidget 3.0.2 since 1 year on x86 and x64 platforms on
> Windows 7 with no matter. Since I have jumped on Windows 10, wxLua crash on
> x64. Same dll, same code. I think, I have found the problem.
>
>
>
> In file wxlstate.cpp In function
>
>
>
> void* LUACALL wxluaT_getuserdatatype(lua_State* L, int stack_idx, int
> wxl_type)
>
>
>
> long int o = (long int)wxlua_touserdata(L, stack_idx, false);
>
>
>
> should be changed in
>
>
>
> size_t o = (size_t)wxlua_touserdata(L, stack_idx, false);
>
>
>
> on Windows platforms to avoid original pointer to be truncated in 32 bits.
> Why it doesn’t crash since 1 year on Win7, I really don’t know, probably
> I’m a lucky man and memory management has changed on Win10 !
>
>
>
Humm, my understanding was that both long and size_t are 4 bytes on a
32-bit architecture and 8 bytes on a 64-bit architecture, but I see now
that there are claims that Visual Studio kept long at 4 bytes on x64. It
seems like there is no guarantees about size_t other than that it will be
unsigned in the C++ standard.
Can you please print sizeof(long) and sizeof(size_t) and let me know what
compiler you use?
I should use an uintptr_t, but older Visual Studio versions don't have
inttypes.h so I've changed it to 'unsigned long long' so it'll work
everywhere. The change is committed to svn.
Regards,
 John
From: Paul K <pau...@ya...> - 2015年10月22日 21:38:56
Hi John,
I noticed that wxlua fails to compile with the current wxwidgets as it
references GetKeysUnicode and SetKeysUnicode methods for
wxStyledTextCtrl, which have been removed in 3.1.
Both of the methods need to be marked as !%wxchkver_3_1_0 in
wxstc_stc.i and modules/wxbind/src/wxstc_bind.cpp needs to be
regenerated.
BTW, wxwidgets has been migrated to github, so the latest version is
here (https://github.com/wxWidgets/wxWidgets) and not in svn.
Paul.
Hi John,
> I'm still in need of having MacNewFile, MacOpenFiles, and MacReopenApp methods (http://docs.wxwidgets.org/trunk/classwx_app.html) and would appreciate any update on when you may have chance to add them.
Do you have any update on Mac* methods or any suggestion on how these
can be added? Maybe you can do one or two of them and I'll use it as
an example to complete the other methods? It would be good to also add
MacPrintFile and MacOpenURL as my product now supports file printing
as well.
If you are not available to work on this, can you recommend someone
who can do this or at least to provide some initial implementation.
Thank you.
Paul.
On Sat, Feb 21, 2015 at 2:52 PM, Paul K <pau...@ya...> wrote:
> Hi John,
>
> I'm still in need of having MacNewFile, MacOpenFiles, and MacReopenApp
> methods (http://docs.wxwidgets.org/trunk/classwx_app.html) and would
> appreciate any update on when you may have chance to add them.
>
> If you don't have time at all to work on these and other methods, could you
> give me a hint on how these can be added or maybe implement one of them and
> I'll take care of the others? I can add existing methods (like those needed
> for wxSTC or wxTreeCtrl), but it seems like these methods need some sort of
> callback and I don't know how to provide that.
>
> Paul.
>
>
> On Thu, Oct 30, 2014 at 11:01 AM, Paul K <pau...@ya...> wrote:
>>
>> Hi John,
>>
>> >> > I'm looking for a way to provide MacNewFile, MacOpenFiles, and
>> >> > MacReopenApp methods
>> >> > (http://docs.wxwidgets.org/trunk/classwx_app.html), but can't figure
>> >> > out how to do this in wxlua and don't see this in any of the
>> >> > examples.
>> >>
>> >> Can these methods be used with the current version of wxlua or do they
>> >> need to be added first?
>> >
>> > They need to be added, it should be doable.
>>
>> Any plans to add these methods?
>>
>> Also, I have a short list of various methods that exist in wxwidgets
>> 3.x, but are missing from wxlua API:
>>
>> wxTopLevelWindow needs EnableFullScreenView
>> wxTreeCtrl needs GetFocusedItem, SetFocusedItem, ClearFocusedItem
>> wxSTC needs ScrollRange, ScrollCaret, SetFontQuality, AddStyledText
>> wxAuiTabArt needs SetColour and SetActiveColour
>>
>> If it makes things easier for you, I can probably submit the initial
>> patch that adds these methods, but AddStyledText seems to be disabled
>> explicitly, so I'd appreciate if you could check why that's the case.
>> Thank you.
>>
>> Also, it's possible to provide my own wxAuiTabArt provider?
>>
>> Paul.
>
>
From: Victor B. <so...@te...> - 2015年10月18日 18:27:55
Hi,
32*1024 - 7 is the maximum string len that is displayed in wxStyledTextCtrl 
with AppendText.
I have not seen anywhere information related.
Is this information in any place?
Is there any way to get a longer display length?
Best
victor 
From: Z.H. <zo...@ye...> - 2015年10月16日 11:43:12
Hi all, wxLua reference manual says the following classes are unavailable:
wxCSConv 	        X 	 	Lua uses ANSI 8-bit strings 
wxEncodingConverter 	X 	 	Lua uses ANSI 8-bit strings 
wxMBConv 	        X 	 	Lua uses ANSI 8-bit strings
wxMBConvFile 	    X 	 	Lua uses ANSI 8-bit strings
wxMBConvUTF16 	    X 	 	Lua uses ANSI 8-bit strings
wxMBConvUTF32 	    X 	 	Lua uses ANSI 8-bit strings
wxMBConvUTF7 	    X 	 	Lua uses ANSI 8-bit strings
wxMBConvUTF8 	    X 	 	Lua uses ANSI 8-bit strings
As far as I know, wxLua unicode build will treat all lua strings as utf-8 strings when converting them from/to wxString's.
It works fine in most situations. But some applications need to read and write files with other encodings
(see for example the post by Victor Bombi : http://sourceforge.net/p/wxlua/mailman/message/33546327/ ).
In this case, wxEncodingConverter and wxMBConv are neccessary.
Is it possible for wxLua to implement the above classes?
From: Z.H. <zo...@ye...> - 2015年10月16日 07:57:24
I was running on Windows 7, 32bit.
At 2015年10月16日 13:11:30,"Paul K" <pau...@ya...> wrote:
>> Running program: cmd /k dir & exit
>> Pid is 6640
>> Process Ended
>> Can Read
>> And no further result. It's very strange.
>
>It is strange. It's as if the program is done, but nothing is
>"waiting" in the output to be read. Did you say you were running on
>Win10? Maybe it's a new "feature"?
>
>I'd try on some other Windows machine you may have access to...
>
>Paul.
From: Paul K <pau...@ya...> - 2015年10月16日 05:11:58
> Running program: cmd /k dir & exit
> Pid is 6640
> Process Ended
> Can Read
> And no further result. It's very strange.
It is strange. It's as if the program is done, but nothing is
"waiting" in the output to be read. Did you say you were running on
Win10? Maybe it's a new "feature"?
I'd try on some other Windows machine you may have access to...
Paul.
From: Z.H. <zo...@ye...> - 2015年10月15日 02:39:50
What I get for that command is:
Running program: cmd /k dir & exit
Pid is 6640
Process Ended
Can Read
And no further result. It's very strange.
At 2015年10月15日 10:13:53,"Paul K" <pau...@ya...> wrote:
>> The command "cmd /k dir & exit" did not work when I ran it from ZBS.
>
>What do you mean by "did not work"? This is what I get for that command:
>
>Running program: cmd /k dir & exit
>Pid is 18556
>Can Read
> Volume in drive D is FILES
> Volume Serial Number is 6AF1-AFBB
>...
>
>If I pass the wrong command, I get "Can Read" and then "No Output",
>which is what you'd expect.
>
>Paul.
>
From: Paul K <pau...@ya...> - 2015年10月15日 02:14:19
> The command "cmd /k dir &amp; exit" did not work when I ran it from ZBS.
What do you mean by "did not work"? This is what I get for that command:
Running program: cmd /k dir & exit
Pid is 18556
Can Read
 Volume in drive D is FILES
 Volume Serial Number is 6AF1-AFBB
...
If I pass the wrong command, I get "Can Read" and then "No Output",
which is what you'd expect.
Paul.
From: Z.H. <zo...@ye...> - 2015年10月15日 01:52:14
The command "cmd /k dir &amp; exit" did not work when I ran it from ZBS.
At 2015年10月14日 22:59:47,"Paul K" <pau...@ya...> wrote:
>> I download wxLua-2.8.12.3-Lua-5.2.2-MSW-Unicode.zip and wrote the following code for testing wxExecute function. But the results of "streamin:Read" function are always empty.
>> local cmd = "cmd /k tree d: & exit"
>> Output("Running program: " .. cmd .. "\n")
>
>I used a slightly different command ("cmd /k dir & exit"), but it
>worked just fine when I ran it from ZeroBrane Studio. Maybe try with a
>different wx.dll library?
>
>Paul.
>
>------------------------------------------------------------------------------
>_______________________________________________
>wxlua-users mailing list
>wxl...@li...
>https://lists.sourceforge.net/lists/listinfo/wxlua-users
From: Paul K <pau...@ya...> - 2015年10月14日 15:00:14
> I download wxLua-2.8.12.3-Lua-5.2.2-MSW-Unicode.zip and wrote the following code for testing wxExecute function. But the results of "streamin:Read" function are always empty.
> local cmd = "cmd /k tree d: & exit"
> Output("Running program: " .. cmd .. "\n")
I used a slightly different command ("cmd /k dir & exit"), but it
worked just fine when I ran it from ZeroBrane Studio. Maybe try with a
different wx.dll library?
Paul.
From: Z.H. <zo...@ye...> - 2015年10月14日 12:52:23
I download wxLua-2.8.12.3-Lua-5.2.2-MSW-Unicode.zip and wrote the following code for testing wxExecute function. But the results of "streamin:Read" function are always empty.
I have tried the exec example contained in wxWidgets' source code. And I could see the redirected output with this command "cmd /k tree d: & exit".
If I replace the command "cmd /k tree d: & exit" with "attrib", I could get the desired result. What's the problem with the following code?
-------------------------------------------------
package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;"
require("wx")
frame = wx.wxFrame( wx.NULL, wx.wxID_ANY,"wxLua Demo", wx.wxDefaultPosition,
 wx.wxSize(600,480), wx.wxDEFAULT_FRAME_STYLE )
console = wxstc.wxStyledTextCtrl(frame, wx.wxID_ANY)
console:Show(true)function Output(message)
 console:AppendText(message)
 console:GotoPos(console:GetLength())endlocal proc, streamin
function ReadIt(event)if streamin and streamin:CanRead()then
 Output("Can Read\n")local str = streamin:Read(4096)
 print(str)
 Output(str .."\n")else
 Output("No Output\n")endendlocal myTimer = wx.wxTimer(frame)
frame:Connect(wx.wxEVT_TIMER, ReadIt)function Execute() 
 proc = wx.wxProcess()
 proc:Redirect()
 proc:Connect(wx.wxEVT_END_PROCESS,function(event)
 myTimer:Stop();
 Output("Process Ended\n")
 ReadIt()
 proc =nilend)local cmd ="cmd /k tree d: & exit"
 Output("Running program: ".. cmd .."\n")local pid = wx.wxExecute(cmd, wx.wxEXEC_ASYNC, proc)
 Output("Pid is ".. pid .."\n")
 streamin = proc and proc:GetInputStream()
 myTimer:Start(500);end 
frame:Show(true)
Execute()
wx.wxGetApp():MainLoop()
From: Paul K <pau...@ya...> - 2015年09月03日 16:13:50
Hi John,
I noticed that there is a memory leak when wxlua script checks for
non-existing properties inside pcall. For example, the following
script leaks about 5M of memory on Windows:
require "wx"
local ctrl = wx.wxTextCtrl()
for _ = 1, 10000 do pcall(function() return ctrl.foo end) end
io.read()
(if you are checking in TaskManager, you need to look for Lua process
under "background processes" section).
Adding "collectgarbage" doesn't help, so the leak seems to be in the
memory allocated outside of Lua.
"pcall" is needed to avoid "wxLua: Unable to call an unknown method
'foo' on a 'wxTextCtrl' type." If the check is for the existing
property, then there is no leak. If I cause the error in "pcall" in
some other way, there is no leak either. I don't think pcall is
causing the issue; there is probably something wrong with the cleanup
after the error.
Do you have any idea on what may be causing this? I wouldn't worry
about it too much, but there is no way to check if the property exists
without wrapping the check into a "pcall" and leaking 0.5k per check
is a bit too much.
As a side note, I'd prefer "obj.foo" check to return "nil" instead of
failing with an error. This would be a behavior consistent with how
fields behave for tables in Lua.
Paul.
From: Laurent R. <lr...@iv...> - 2015年09月03日 12:21:39
Hi John,
At first, i would like to tell you how big is your works : thanks for all.
I use wxLua with wxWidget 3.0.2 since 1 year on x86 and x64 platforms on Windows 7 with no matter. Since I have jumped on Windows 10, wxLua crash on x64. Same dll, same code. I think, I have found the problem.
In file wxlstate.cpp In function
void* LUACALL wxluaT_getuserdatatype(lua_State* L, int stack_idx, int wxl_type)
 long int o = (long int)wxlua_touserdata(L, stack_idx, false);
should be changed in
 size_t o = (size_t)wxlua_touserdata(L, stack_idx, false);
on Windows platforms to avoid original pointer to be truncated in 32 bits. Why it doesn't crash since 1 year on Win7, I really don't know, probably I'm a lucky man and memory management has changed on Win10 !
I guess, it could help.
Regards,
Laurent.
From: John L. <jla...@gm...> - 2015年06月15日 16:51:13
On Jun 15, 2015 12:31 PM, "Дмитрий" <dm...@ya...> wrote:
>
> Hello!
>
> I need to get a colour out of wxPalette (I need to create a wxMask out of
it later), and I can’t figure out how to translate the C++ function GetRGB
into Lua. In C++, the function returns data in pointers, but wxluaref.html
suggest these arguments are not used in Lua:
>
> // %override [bool, char red, char green, char blue]
wxPalette::GetRGB(int pixel) const;
> // C++ Func: bool GetRGB(int pixel, unsigned char* red, unsigned
char* green, unsigned char* blue) const;
> bool GetRGB(int pixel) const;
>
> Which practically means GetRGB is useless, since it just returns an error
code and gives no way to get R, G, and B..?
No, what it means is that it returns four values rather than returning them
through the input pointers.
> Am I missing something? How do I create a wxMask for the palette colour
with index #0?
>
>
> The documentation says that in Windows I can create a wxBitmap with a
palette and use wx.wxMask(bitmap, 0), but I didn’t get this to work
(probably because I’m using png and not bmp?). Also, I don’t really want my
code to run in Windows only.
>
I believe that wxWidgets supports palletized pngs, but I have not tried
this myself.
> I'm not sure if this is the right place for
Yes, though it may take a day for me to respond.
Regards,
 John
From: Дмитрий <dm...@ya...> - 2015年06月15日 10:31:07
Hello!
I need to get a colour out of wxPalette (I need to create a wxMask out of it later), and I can’t figure out how to translate the C++ function GetRGB into Lua. In C++, the function returns data in pointers, but wxluaref.html suggest these arguments are not used in Lua:
 // %override [bool, char red, char green, char blue] wxPalette::GetRGB(int pixel) const;
 // C++ Func: bool GetRGB(int pixel, unsigned char* red, unsigned char* green, unsigned char* blue) const;
 bool GetRGB(int pixel) const; 
Which practically means GetRGB is useless, since it just returns an error code and gives no way to get R, G, and B..?
Am I missing something? How do I create a wxMask for the palette colour with index #0?
The documentation says that in Windows I can create a wxBitmap with a palette and use wx.wxMask(bitmap, 0), but I didn’t get this to work (probably because I’m using png and not bmp?). Also, I don’t really want my code to run in Windows only.
I'm not sure if this is the right place for such questions, if not, please point me where I can ask them. Thanks.
Best regards,
Dmitry Kushnariov
From: Andre A. <ar...@ki...> - 2015年06月01日 14:53:12
I have modified EvaluateExpr for newer versions of lua.
This makes global variables display properly.
Expression does not want to work and I really have no idea why.
The code is right must be some string conflict problems.
bool wxLuaDebugTarget::EvaluateExpr(int exprRef, const wxString 
&strExpr) // FIXME - check this code
{
 wxString strResult(wxT("Error"));
 int nReference = LUA_NOREF;
 EnterLuaCriticalSection();
 {
 lua_State* L = m_wxlState.GetLuaState();
 int nOldTop = lua_gettop(L);
 if (wxStrpbrk(strExpr.c_str(), wxT(" ~=<>+-*/%(){}[]:;,.\"'")) 
!= NULL)
 {
 // an expression
 wxLuaCharBuffer charbuf(strExpr);
 int nResult = luaL_loadbuffer(L, charbuf.GetData(), 
charbuf.Length(), "debug");
 if (nResult == 0)
 nResult = lua_pcall(L, 0, LUA_MULTRET, 0); // call main
 if (nResult != 0)
 wxlua_pushwxString(L, wxlua_LUA_ERR_msg(nResult));
 else if (lua_gettop(L) == nOldTop)
 lua_pushliteral(L, "OK");
 nReference = m_wxlState.wxluaR_Ref(-1, 
&wxlua_lreg_refs_key);
 lua_settop(L, nOldTop); // throw out all return values
 }
 else
 {
 lua_Debug ar = INIT_LUA_DEBUG;
 int stack_level = 0; // 0 is the current running 
function
 bool variable_found = false;
 while (lua_getstack(L, stack_level++, &ar) != 0)
 {
 int stack_index = 1; // 1 is the first local stack index
 wxString name = lua2wx(lua_getlocal(L, &ar, 
stack_index));
 while (!name.IsEmpty())
 {
 if (strExpr == name)
 {
 nReference = m_wxlState.wxluaR_Ref(-1, 
&wxlua_lreg_refs_key);
 lua_pop(L, 1);
 variable_found = true;
 break;
 }
 lua_pop(L, 1);
 name = lua2wx(lua_getlocal(L, &ar, ++stack_index));
 }
 if (variable_found)
 break;
 }
			lua_settop(L, nOldTop); // the table of globals.
 if (!variable_found)
 {
#if LUA_VERSION_NUM < 502
 lua_pushvalue(L, LUA_GLOBALSINDEX);
 lua_pushnil(L);
 while (lua_next(L, -2) != 0)
 {
 if (lua_type(L, -2) == LUA_TSTRING)
 {
 wxString name = lua2wx(lua_tostring(L, -2));
 if (strExpr == name)
 {
 nReference = m_wxlState.wxluaR_Ref(-1, 
&wxlua_lreg_refs_key); // reference value
 lua_pop(L, 2); // pop key and value
 variable_found = true;
 break;
 }
 }
 lua_pop(L, 1); // removes 'value';
 }
#else
				lua_getglobal(L, strExpr);
				if (lua_type(L, -1) != LUA_TNONE)
				{
 nReference = m_wxlState.wxluaR_Ref(-1, 
&wxlua_lreg_refs_key); // reference value
				}
				lua_pop(L, 1);
#endif
 }
 lua_settop(L, nOldTop); // the table of globals.
 }
 if ((nReference != LUA_NOREF) && 
m_wxlState.wxluaR_GetRef(nReference, &wxlua_lreg_refs_key))
 {
 m_wxlState.wxluaR_Unref(nReference, &wxlua_lreg_refs_key);
 int wxl_type = 0;
 wxString value;
 wxLuaDebugData::GetTypeValue(L, -1, &wxl_type, value);
 strResult.Printf(wxT("%s : %s"), wxluaT_typename(L, 
wxl_type).c_str(), value.c_str());
 lua_pop(L, 1);
 }
 }
 LeaveLuaCriticalSection();
 return NotifyEvaluateExpr(exprRef, strResult);
}
Good luck
Andre
From: Philipp Ü. <mu...@tu...> - 2015年05月21日 19:55:24
On 2015年5月18日 18:14:58 -0400
John Labenski <jla...@gm...> wrote:
> On Mon, May 18, 2015 at 4:01 AM, Philipp Überbacher
> <mu...@tu...> wrote:
> 
> > On 2015年5月18日 09:25:06 +0200
> > Philipp Überbacher <mu...@tu...> wrote:
> >
> > > >
> > > > > wxlbind.cpp:831:51: error: ‘luaL_register’ was not declared in
> > > > > this scope luaL_register(L, wx2lua(m_nameSpace), wxlualib);
> > > >
> > > > You probably also need -DLUA_COMPAT_MODULE, as luaL_register is
> > > > not part of Lua 5.2 if the compatibility mode is not turned on.
> > > >
> >
> 
> 
> What you have seems right when you call cmake.
> 
> In the CMakeLists.txt in the root wxLua dir is this check for Lua 5.2
> to add the LUA_COMPAT_ALL #define, which also #defines
> LUA_COMPAT_MODULE in luaconf.h.
> 
> if (${wxLua_LUA_LIBRARY_VERSION} VERSION_EQUAL 5.2)
> set(wxLua_CXX_DEFINITIONS ${wxLua_CXX_DEFINITIONS}
> -DLUA_COMPAT_ALL) # Match build used in default 5.2 Makefile
> endif()
> 
> 
> When you build run:
> 
> $ make -j1 VERBOSE=1
> 
> and post back what is printed. It should show that "-I" is specified
> to your Lua include dir and the link path to your Lua lib as well as
> having the -DLUA_COMPAT_ALL flag.
> 
> You might want to also check that the lua.h you want is in
> "-DwxLua_LUA_INCLUDE_DIR=/usr/include" and that you're not pulling in
> some other lua.h file. A very simple check is to temporarily put some
> invalid code in your /uar/include/lua.h to force an error.
> 
> Regards,
> John
Thanks John,
I did not try that.
However, the issue could be fixed by being more explicit about the
include directory:
 -DwxLua_LUA_INCLUDE_DIR=/usr/include/lua5.2 \
instead of:
 -DwxLua_LUA_INCLUDE_DIR=/usr/include \
Regards,
Philipp
From: John L. <jla...@gm...> - 2015年05月18日 22:15:05
On Mon, May 18, 2015 at 4:01 AM, Philipp Überbacher <mu...@tu...>
wrote:
> On 2015年5月18日 09:25:06 +0200
> Philipp Überbacher <mu...@tu...> wrote:
>
> > >
> > > > wxlbind.cpp:831:51: error: ‘luaL_register’ was not declared in
> > > > this scope luaL_register(L, wx2lua(m_nameSpace), wxlualib);
> > >
> > > You probably also need -DLUA_COMPAT_MODULE, as luaL_register is not
> > > part of Lua 5.2 if the compatibility mode is not turned on.
> > >
>
What you have seems right when you call cmake.
In the CMakeLists.txt in the root wxLua dir is this check for Lua 5.2 to
add the LUA_COMPAT_ALL #define, which also #defines LUA_COMPAT_MODULE in
luaconf.h.
if (${wxLua_LUA_LIBRARY_VERSION} VERSION_EQUAL 5.2)
 set(wxLua_CXX_DEFINITIONS ${wxLua_CXX_DEFINITIONS} -DLUA_COMPAT_ALL) #
Match build used in default 5.2 Makefile
endif()
When you build run:
$ make -j1 VERBOSE=1
and post back what is printed. It should show that "-I" is specified to
your Lua include dir and the link path to your Lua lib as well as having
the -DLUA_COMPAT_ALL flag.
You might want to also check that the lua.h you want is in
"-DwxLua_LUA_INCLUDE_DIR=/usr/include" and that you're not pulling in some
other lua.h file. A very simple check is to temporarily put some invalid
code in your /uar/include/lua.h to force an error.
Regards,
 John
From: Victor B. <so...@te...> - 2015年05月18日 14:26:48
also, if you added -DLUA_COMPAT_MODULE after running cmake perhaps you need 
to delete directory and run cmake from scratch again
----- Original Message ----- 
From: "Philipp Überbacher" <mu...@tu...>
To: <wxl...@li...>
Sent: Monday, May 18, 2015 10:01 AM
Subject: Re: [wxlua-users] Problem compiling wxlua svn 247
> On 2015年5月18日 09:25:06 +0200
> Philipp Überbacher <mu...@tu...> wrote:
>
>> On 2015年5月17日 13:25:49 -0700
>> Paul K <pau...@ya...> wrote:
>>
>> > Hi Philipp ,
>> >
>> > > wxlbind.cpp:831:51: error: ‘luaL_register’ was not declared in
>> > > this scope luaL_register(L, wx2lua(m_nameSpace), wxlualib);
>> >
>> > You probably also need -DLUA_COMPAT_MODULE, as luaL_register is not
>> > part of Lua 5.2 if the compatibility mode is not turned on.
>> >
>> > Paul.
>>
>>
>> Thanks Paul,
>>
>> I did add -DLUA_COMPAT_MODULE=TRUE
>>
>> I got the following warning, which seems to suggest that this option
>> does not exist:
>>
>> CMake Warning:
>> Manually-specified variables were not used by the project:
>>
>> LUA_COMPAT_MODULE
>>
>> And the build still fails. This option does not show up in ccmake
>> either. Did I do something wrong?
>>
>> Regards,
>> Philipp
>
> Answering my own question:
> LUA_COMPAT_MODULE seems to be a compiletime option for Lua, not wxlua.
> One that my distribution does not use.
> I get the same error when I set all the wxlua options to 5.1, and that
> still contains luaL_register, according to documentation
> (http://www.lua.org/manual/5.1/manual.html).
>
> My guess is that cmake still uses whatever Lua version it can find on
> the system. While I do have Lua 5.1 and 5.2 installed, the default Lua
> version of my distribution is now 5.3. So, cmake probably uses that,
> despite me specifying something else. I guess that counts as a bug in
> the cmake script.
>
> I could build it successfully using the Lua 5.1 that ships with wxLua.
> (-DwxLua_LUA_LIBRARY_USE_BUILTIN=1)
> I just hope that things will work out with that.
>
> Regards,
> Philipp
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> wxlua-users mailing list
> wxl...@li...
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
> 
From: Philipp Ü. <mu...@tu...> - 2015年05月18日 08:02:14
On 2015年5月18日 09:25:06 +0200
Philipp Überbacher <mu...@tu...> wrote:
> On 2015年5月17日 13:25:49 -0700
> Paul K <pau...@ya...> wrote:
> 
> > Hi Philipp ,
> > 
> > > wxlbind.cpp:831:51: error: ‘luaL_register’ was not declared in
> > > this scope luaL_register(L, wx2lua(m_nameSpace), wxlualib);
> > 
> > You probably also need -DLUA_COMPAT_MODULE, as luaL_register is not
> > part of Lua 5.2 if the compatibility mode is not turned on.
> > 
> > Paul.
> 
> 
> Thanks Paul,
> 
> I did add -DLUA_COMPAT_MODULE=TRUE
> 
> I got the following warning, which seems to suggest that this option
> does not exist:
> 
> CMake Warning:
> Manually-specified variables were not used by the project:
> 
> LUA_COMPAT_MODULE
> 
> And the build still fails. This option does not show up in ccmake
> either. Did I do something wrong?
> 
> Regards,
> Philipp
Answering my own question:
LUA_COMPAT_MODULE seems to be a compiletime option for Lua, not wxlua.
One that my distribution does not use.
I get the same error when I set all the wxlua options to 5.1, and that
still contains luaL_register, according to documentation
(http://www.lua.org/manual/5.1/manual.html).
My guess is that cmake still uses whatever Lua version it can find on
the system. While I do have Lua 5.1 and 5.2 installed, the default Lua
version of my distribution is now 5.3. So, cmake probably uses that,
despite me specifying something else. I guess that counts as a bug in
the cmake script.
I could build it successfully using the Lua 5.1 that ships with wxLua.
(-DwxLua_LUA_LIBRARY_USE_BUILTIN=1)
I just hope that things will work out with that.
Regards,
Philipp
From: Philipp Ü. <mu...@tu...> - 2015年05月18日 07:25:15
On 2015年5月17日 13:25:49 -0700
Paul K <pau...@ya...> wrote:
> Hi Philipp ,
> 
> > wxlbind.cpp:831:51: error: ‘luaL_register’ was not declared in this
> > scope luaL_register(L, wx2lua(m_nameSpace), wxlualib);
> 
> You probably also need -DLUA_COMPAT_MODULE, as luaL_register is not
> part of Lua 5.2 if the compatibility mode is not turned on.
> 
> Paul.
Thanks Paul,
I did add -DLUA_COMPAT_MODULE=TRUE
I got the following warning, which seems to suggest that this option
does not exist:
CMake Warning:
 Manually-specified variables were not used by the project:
 LUA_COMPAT_MODULE
And the build still fails. This option does not show up in ccmake
either. Did I do something wrong?
Regards,
Philipp
50 messages has been excluded from this view by a project administrator.

Showing results of 3998

<< < 1 2 3 4 5 6 .. 160 > >> (Page 4 of 160)
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /