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
S M T W T F S





1
2
3
4
5
6
7
8
9
10
11
12
13
(2)
14
15
(5)
16
17
(7)
18
(1)
19
(1)
20
(1)
21
(2)
22
23
(2)
24
(7)
25
(2)
26
27
28
29
30

Showing results of 30

1 2 > >> (Page 1 of 2)
From: Andreas F. <an...@fa...> - 2013年11月25日 14:23:34
On 25.11.2013 at 05:17 John Labenski wrote:
> On Sun, Nov 24, 2013 at 5:13 AM, Andreas Falkenhahn <an...@fa...> wrote:
> 
> Hi John,
> 
> 
 >>> I'm trying to port some C++ code to wxLua that derives a new class from
 >>> wxTextCtrl and then overrides the OnRightClick() method of this class
 >>> to do some custom stuff when the user presses RMB over the widget.
 >> Catch EVT_RIGHT_UP and call event.Skip() for normal processing.
 >> Calling virtual functions like this is discouraged and may not
 >> continue to work in the future for all platforms.
> 
> Tried it like this but it doesn't work:
> 
> frame:Connect(100, wx.wxEVT_RIGHT_UP, function(e) print("hello") end)
> 
> 
> What is supposed to happen? wxWidgets 2.8 and 3.0 don't seem to
> have a OnRightClick() function at all.
Right, sorry, I've overlooked the fact that the code I'm trying to port
to wxLua doesn't actually override OnRightClick() but connects an event
handler to EVT_RIGHT_UP like this:
BEGIN_EVENT_TABLE(WidgetsTextCtrl, wxTextCtrl)
 EVT_RIGHT_UP(WidgetsTextCtrl::OnRightClick)
END_EVENT_TABLE()
So the code in wxLua has to look like this:
textCtrl:Connect(wx.wxEVT_RIGHT_UP, function(e) print("hello") end)
Then it works fine.
-- 
Best regards,
 Andreas Falkenhahn mailto:an...@fa...
From: John L. <jla...@gm...> - 2013年11月25日 04:17:47
On Sun, Nov 24, 2013 at 5:13 AM, Andreas Falkenhahn
<an...@fa...>wrote:
> Hi John,
>
>
> >> I'm trying to port some C++ code to wxLua that derives a new class from
> >> wxTextCtrl and then overrides the OnRightClick() method of this class
> >> to do some custom stuff when the user presses RMB over the widget.
> > Catch EVT_RIGHT_UP and call event.Skip() for normal processing.
> > Calling virtual functions like this is discouraged and may not
> > continue to work in the future for all platforms.
>
> Tried it like this but it doesn't work:
>
> frame:Connect(100, wx.wxEVT_RIGHT_UP, function(e) print("hello") end)
>
>
>
What is supposed to happen? wxWidgets 2.8 and 3.0 don't seem to have a
OnRightClick() function at all.
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/include/wx/textctrl.h?view=markup
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/include/wx/msw/textctrl.h?view=markup
...
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/branches/WX_2_8_BRANCH/include/wx/textctrl.h?view=markup
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/branches/WX_2_8_BRANCH/include/wx/msw/textctrl.h?view=markup
...
Regards,
 John
From: Paul K <pau...@ya...> - 2013年11月24日 17:58:59
Hi Lucas,
> I wonder if there is any debugger done in wx.lua that have function Step In
> Step out.Tenho wxLua on a project at my college (UFOP) in Brazil and need such
> a function to be used in my code.
Yes, there is an example in samples/editor.wx.lua, which implements
step-in and step-out commands.
I have also developed an IDE roughly based on that example, which
implemented that functionality using MobDebug (instead of the debugger
components that come with wxlua); more details here:
http://www.freelists.org/post/zerobrane/Step-In-Step-Out-in-LUA,1
Paul.
From: Paul K <pau...@ya...> - 2013年11月24日 17:54:44
Hi Andreas,
> My control is a wxTextCtrl so I don't think the tree ctrl events will work
> on them...
My bad; I misread wxTextCtrl as wxTreeCtrl. Apologies for the noise.
Paul.
From: Lucas S. <luc...@ya...> - 2013年11月24日 16:15:14
Hello,
I wonder if there is any debugger done in wx.lua that have function Step In 
Step out.Tenho wxLua on a project at my college (UFOP) in Brazil and need such 
a function to be used in my code.
From: Andreas F. <an...@fa...> - 2013年11月24日 10:12:16
Hi John,
On 24.11.2013 at 06:44 John Labenski wrote:
> On Nov 23, 2013 4:30 PM, "Andreas Falkenhahn" <an...@fa...> wrote:
>> Hi,
>> I'm trying to port some C++ code to wxLua that derives a new class from
>> wxTextCtrl and then overrides the OnRightClick() method of this class
>> to do some custom stuff when the user presses RMB over the widget.
> Catch EVT_RIGHT_UP and call event.Skip() for normal processing.
> Calling virtual functions like this is discouraged and may not
> continue to work in the future for all platforms.
Tried it like this but it doesn't work:
frame:Connect(100, wx.wxEVT_RIGHT_UP, function(e) print("hello") end)
(100 is the ID of the wxTextCtrl)
 >> Is it possible to do this in wxLua as well? I tried the following but
>> it didn't work:
>> local ctrl = wx.wxTextCtrl(...)
>> ctrl.OnRightClick = function(event) print("test") end
> C++ requires you to subclass and override all virtual functions.
> The speed/size overhead to do this for all classes/functions would
> be enormous so wxLua only does this where absolutely necessary.
> John
Ok, makes sense.
-- 
Best regards,
 Andreas Falkenhahn mailto:an...@fa...
From: Andreas F. <an...@fa...> - 2013年11月24日 10:11:02
Hi Paul,
On 24.11.2013 at 02:12 Paul K wrote:
> Hi Andreas,
>> I'm trying to port some C++ code to wxLua that derives a new class from
>> wxTextCtrl and then overrides the OnRightClick() method of this class
>> to do some custom stuff when the user presses RMB over the widget.
> I'm using wxEVT_COMMAND_TREE_ITEM_MENU; I think there is also
> TREE_ITEM_RIGHT_CLICK, but the first one works well for me (I'm using
> it to generate a context menu). Or did I misunderstand what you are
> trying to do?
My control is a wxTextCtrl so I don't think the tree ctrl events will work
on them...
-- 
Best regards,
 Andreas Falkenhahn mailto:an...@fa...
From: John L. <jla...@gm...> - 2013年11月24日 05:44:49
On Nov 23, 2013 4:30 PM, "Andreas Falkenhahn" <an...@fa...>
wrote:
>
> Hi,
>
> I'm trying to port some C++ code to wxLua that derives a new class from
> wxTextCtrl and then overrides the OnRightClick() method of this class
> to do some custom stuff when the user presses RMB over the widget.
Catch EVT_RIGHT_UP and call event.Skip() for normal processing. Calling
virtual functions like this is discouraged and may not continue to work in
the future for all platforms.
> Is it possible to do this in wxLua as well? I tried the following but
> it didn't work:
>
> local ctrl = wx.wxTextCtrl(...)
> ctrl.OnRightClick = function(event) print("test") end
>
C++ requires you to subclass and override all virtual functions. The
speed/size overhead to do this for all classes/functions would be enormous
so wxLua only does this where absolutely necessary.
John
From: Paul K <pau...@ya...> - 2013年11月24日 02:20:47
Hi Andreas,
> I'm trying to port some C++ code to wxLua that derives a new class from
> wxTextCtrl and then overrides the OnRightClick() method of this class
> to do some custom stuff when the user presses RMB over the widget.
I'm using wxEVT_COMMAND_TREE_ITEM_MENU; I think there is also
TREE_ITEM_RIGHT_CLICK, but the first one works well for me (I'm using
it to generate a context menu). Or did I misunderstand what you are
trying to do?
Paul.
On Sat, Nov 23, 2013 at 1:31 PM, Andreas Falkenhahn
<an...@fa...> wrote:
> Hi,
>
> I'm trying to port some C++ code to wxLua that derives a new class from
> wxTextCtrl and then overrides the OnRightClick() method of this class
> to do some custom stuff when the user presses RMB over the widget.
>
> Is it possible to do this in wxLua as well? I tried the following but
> it didn't work:
>
> local ctrl = wx.wxTextCtrl(...)
> ctrl.OnRightClick = function(event) print("test") end
>
> --
> Best regards,
> Andreas Falkenhahn mailto:an...@fa...
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> wxlua-users mailing list
> wxl...@li...
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
From: Andreas F. <an...@fa...> - 2013年11月23日 21:30:03
Hi,
I'm trying to port some C++ code to wxLua that derives a new class from
wxTextCtrl and then overrides the OnRightClick() method of this class
to do some custom stuff when the user presses RMB over the widget. 
Is it possible to do this in wxLua as well? I tried the following but
it didn't work:
local ctrl = wx.wxTextCtrl(...)
ctrl.OnRightClick = function(event) print("test") end
-- 
Best regards,
 Andreas Falkenhahn mailto:an...@fa...
From: Andreas F. <an...@fa...> - 2013年11月23日 11:13:43
Hi John,
On 21.11.2013 at 19:38 John Labenski wrote:
> This would be the expected behavior, I think. You are installing
> TWO callback handlers so both are called if their patterns match.
> I would guess that the difference is that maybe you are calling
> event.Skip(true/false) or not at all in the two different programs.
> Note that not calling event.Skip() is the same as calling
> event.Skip(false) and that skipping the event means that the event
> is propagated to the next matching handler (if one exists).
> 
> For simplicity, if you need the wxID_ANY I would only have that one
> handler and use a "case" style statement to route the event to any specialized handler.
Ok, this has turned out to be wxWidgets peculiarity. Consider the following
event table:
BEGIN_EVENT_TABLE(MyFrame, wxFrame) 
 EVT_RADIOBOX(RadioPage_Radio, MyFrame::OnRadioBox) 
 EVT_RADIOBOX(wxID_ANY, MyFrame::OnCheckOrRadioBox) 
END_EVENT_TABLE()
To convert this event table into a sequence of Connect() calls, you
have to invert the order, i.e.:
Connect(wxID_ANY, wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(MyFrame::OnCheckOrRadioBox)); 
Connect(RadioPage_Radio, wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(MyFrame::OnRadioBox)); 
This is because Connect() adds new events at the *beginning* of the
event handler list. I didn't know that and used the order of the
event table when converting it to a series of Connect() calls which
led to the general handler getting called first.
-- 
Best regards,
 Andreas Falkenhahn mailto:an...@fa...
From: John L. <jla...@gm...> - 2013年11月21日 18:39:05
On Thu, Nov 21, 2013 at 11:32 AM, Andreas Falkenhahn <an...@fa...
> wrote:
> Hi,
>
> in wxWidgets I can do the following:
>
> BEGIN_EVENT_TABLE(RadioWidgetsPage, WidgetsPage)
> EVT_RADIOBOX(RadioPage_Radio, RadioWidgetsPage::OnRadioBox)
> EVT_RADIOBOX(wxID_ANY, RadioWidgetsPage::OnRadioBox2)
> END_EVENT_TABLE()
>
> OnRadioBox() should be called when the wxRadioBox that has the id
> RadioPage_Radio
> is clicked, otherwise OnRadioBox2 should be called. In wxLua this looks
> like this:
>
>
I would have assumed that OnRadioBox2 would be called for ALL events of ANY
id.
> this:Connect(RadioPage_Radio, wx.wxEVT_COMMAND_RADIOBOX_SELECTED,
> OnRadioBox)
> this:Connect(wx.wxID_ANY, wx.wxEVT_COMMAND_RADIOBOX_SELECTED, OnRadioBox2)
>
> However, the use of wxID_ANY seems to confuse wxLua here because even if
> the
> user clicks the wxRadioBox that has the id RadioPage_Radio wxLua will still
> run the OnRadioBox2() callback. Is that a bug or some kind of limitation?
>
>
This would be the expected behavior, I think. You are installing TWO
callback handlers so both are called if their patterns match.
I would guess that the difference is that maybe you are calling
event.Skip(true/false) or not at all in the two different programs. Note
that not calling event.Skip() is the same as calling event.Skip(false) and
that skipping the event means that the event is propagated to the next
matching handler (if one exists).
For simplicity, if you need the wxID_ANY I would only have that one handler
and use a "case" style statement to route the event to any specialized
handler.
Regards,
 John
From: Andreas F. <an...@fa...> - 2013年11月21日 16:31:53
Hi,
in wxWidgets I can do the following:
BEGIN_EVENT_TABLE(RadioWidgetsPage, WidgetsPage)
 EVT_RADIOBOX(RadioPage_Radio, RadioWidgetsPage::OnRadioBox)
 EVT_RADIOBOX(wxID_ANY, RadioWidgetsPage::OnRadioBox2)
END_EVENT_TABLE()
OnRadioBox() should be called when the wxRadioBox that has the id RadioPage_Radio
is clicked, otherwise OnRadioBox2 should be called. In wxLua this looks like this:
this:Connect(RadioPage_Radio, wx.wxEVT_COMMAND_RADIOBOX_SELECTED, OnRadioBox) 	 	 
this:Connect(wx.wxID_ANY, wx.wxEVT_COMMAND_RADIOBOX_SELECTED, OnRadioBox2)
However, the use of wxID_ANY seems to confuse wxLua here because even if the
user clicks the wxRadioBox that has the id RadioPage_Radio wxLua will still
run the OnRadioBox2() callback. Is that a bug or some kind of limitation?
Thanks!
-- 
Best regards,
 Andreas Falkenhahn mailto:an...@fa...
From: John L. <jla...@gm...> - 2013年11月20日 18:34:11
On Tue, Nov 19, 2013 at 4:07 PM, Andre Arpin <ar...@ki...> wrote:
> file FindwxWidgets
>
> please add:
>
> wxbase30${_UCD}${_DBG}
> wxbase30${_UCD}${_DBG}_${LIB}
> wxmsw${_UNV}30${_UCD}${_DBG}
> wxmsw${_UNV}30${_UCD}${_DBG}_${LIB}
>
> in the various FIND_LIBRARY invocation.
>
>
Thanks, I'll add it later today.
I'm not sure what to do in the long term as this file is a little bit of a
mess (not my code) and having hard-coded versions like it has is a bad
idea, but I don't want to have to completely rewrite it.
Regards,
 John
From: Andre A. <ar...@ki...> - 2013年11月19日 21:07:47
file FindwxWidgets 
please add:
wxbase30${_UCD}${_DBG}
wxbase30${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}30${_UCD}${_DBG}
wxmsw${_UNV}30${_UCD}${_DBG}_${LIB}
in the various FIND_LIBRARY invocation.
Thank you 
Andre
From: Andreas F. <an...@fa...> - 2013年11月18日 22:06:48
On 17.11.2013 at 19:37 John Labenski wrote:
> On Sun, Nov 17, 2013 at 9:21 AM, Andreas Falkenhahn <an...@fa...>wrote:
> 
> Hi,
> 
> what's the recommended way to prevent objects from being garbage collected?
> For example, I create a wxImageList and pass it to wxNotebook::SetImageList().
> As wxNotebook::SetImageList() doesn't take ownership of the list it could
> happen that the garbage collector kills the wxImageList that I passed to
> SetImageList().
> 
> To prevent it from being collected I could assign the wxImageList to a global
> variable but that doesn't look like a nice solution.... it would be nicer
> if it were possible to reference the wxImageList somehow but I don't see
> how this is possible. wxObject has a Ref() method but that doesn't seem to
> be up for the job.
> 
> You're right, wxObject::Ref() is not what you want, in wxLua it
> will cause a memory leak unless you remember to call UnRef() on it.
> The best way is to either make it a global or attach the image list
> to some other object that will live at least as long as the window it's attached to. 
> You can also simply add it to the window itself.
> local notebook = wx.wxNotebook(...)
> local imagelist = wx.wxImageList(...)
> notebook.imagelist = imagelist -- it is now a member of the notebook's table
> notebook.SetImageList(imagelist)
Ok, thanks.
-- 
Best regards,
 Andreas Falkenhahn mailto:an...@fa...
From: John L. <jla...@gm...> - 2013年11月17日 18:56:27
On Sun, Nov 17, 2013 at 12:57 PM, Victor Bombi <so...@te...>wrote:
> Hello John
>
> >It looks like wxTabFrame is not exposed though any header file.
>
> It is defined in auibook.cpp:2799 (2.8.12) (should it be a header file?)
>
>
>
Probably, but there's not a lot we can do about it. Normal wxWidgets
installs will not install the cpp files so there's no good way to find it
and it doesn't look like you can #include it since it actually contains
code and we'd get linker errors about duplicate functions.
I do have a scheme that may work, but it is quite fragile. wxLua declares
the wxTabFrame itself and we cross our fingers that it doesn't change too
much. If it does then wxLua will become a mess of #if wxverX then declare
one version, #else if wxverY then a different one, #else ... This is hacky
to me and I really prefer to keep wxLua reasonably "clean", but in this
case it may be unavoidable.
Regards,
 John
From: John L. <jla...@gm...> - 2013年11月17日 18:50:56
On Sun, Nov 17, 2013 at 2:34 AM, Paul K <pau...@ya...> wrote:
> Hi Kent,
>
> I just compiled my wxlua based application with wxwidgets 3.0 couple
> of days ago and haven't seen any issues/crashes yet. I'll try to run
> the samples tomorrow (don't have access to my MacBook right now) to
> check if there are any issues with them.
>
> > - Is this setup supposed to work at all, i.e. wxLua with wxWindows 3?
>
> I'd say so. I've been using wxwidgets 2.9.5 for several months and
> have compiled/run wxwidgets 3.0 (including different pre-release
> versions) without issues.
>
>
It should work, but since I only own a rather antique Mac mini I don't
regularly use it and so my testing on it is minimal. However, besides the
rather odd (to me at least) mac "app" structure there's no reason why wxLua
would not work as well on OSX as on MSW or Linux.
> > I tried compile from source and run wxWindows 3.0.0, wxLua 2.8.12.3 on
> > OS X 10.8.5 (XCode 5.0.2). The actual compile went fine
> >
> > cd wxWidgets-3.0.0
> > ./configure --prefix=/usr/local
> > make
> > sudo make install
> > cd ../wxLua-2.8.12.3-src
> > mkdir obj ; cd obj
> > cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ..
> > make
> > sudo make install
>
Did you follow these directions to build wxWidgets?
http://wxlua.sourceforge.net/docs/install.html#C2.6
If these are not the best way, please let me know and I will amend the
directions.
>
> > Crashed Thread: 0 Dispatch queue: com.apple.main-thread
> >
> > Exception Type: EXC_BAD_ACCESS (SIGSEGV)
> > Exception Codes: KERN_INVALID_ADDRESS at 0xfffffffffffffff8
> >
> > VM Regions Near 0xfffffffffffffff8:
> > --> shared memory 00007ffffff3b000-00007ffffff3c000 [ 4K]
> r-x/r-x SM=SHM
> >
> > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> > 0 libwx_baseu-3.0.dylib 0x000000010da5332f (anonymous
> namespace)::wxFileSystemObjectExists(wxString const&, int) + 367
> > 1 libwx_baseu-3.0.dylib 0x000000010da53139
> wxFileName::FileExists() const + 57
> > 2 libwx_baseu-3.0.dylib 0x000000010da23f36
> wxFileConfig::Init() + 1718
>
>
This should definitely not happen and seems like it may not be related to
wxLua. Is there something special about the path? The wxLua executable
tries to open a config file in your "user config dir" to load previous
window settings and simple stuff like that.
Note that the wxLua.app program is simply samples/editor.wx.lua embedded in
the executable.
You can also run it this way:
open -a wxLua --args editor.wx.lua
Here's where the fileconfig is created...
http://sourceforge.net/p/wxlua/svn/HEAD/tree/trunk/wxLua/samples/editor.wx.lua#l185
When I can get some time I will try to build it on OSX and see what happens.
Regards,
 John
From: John L. <jla...@gm...> - 2013年11月17日 18:37:50
On Sun, Nov 17, 2013 at 9:21 AM, Andreas Falkenhahn
<an...@fa...>wrote:
> Hi,
>
> what's the recommended way to prevent objects from being garbage collected?
> For example, I create a wxImageList and pass it to
> wxNotebook::SetImageList().
> As wxNotebook::SetImageList() doesn't take ownership of the list it could
> happen that the garbage collector kills the wxImageList that I passed to
> SetImageList().
>
> To prevent it from being collected I could assign the wxImageList to a
> global
> variable but that doesn't look like a nice solution.... it would be nicer
> if it were possible to reference the wxImageList somehow but I don't see
> how this is possible. wxObject has a Ref() method but that doesn't seem to
> be up for the job.
>
>
You're right, wxObject::Ref() is not what you want, in wxLua it will cause
a memory leak unless you remember to call UnRef() on it.
The best way is to either make it a global or attach the image list to some
other object that will live at least as long as the window it's attached
to.
You can also simply add it to the window itself.
local notebook = wx.wxNotebook(...)
local imagelist = wx.wxImageList(...)
notebook.imagelist = imagelist -- it is now a member of the notebook's table
notebook.SetImageList(imagelist)
Regards,
 John
From: Victor B. <so...@te...> - 2013年11月17日 17:58:05
Hello John
>It looks like wxTabFrame is not exposed though any header file. 
It is defined in auibook.cpp:2799 (2.8.12) (should it be a header file?)
victor
From: Andreas F. <an...@fa...> - 2013年11月17日 14:20:58
Hi,
what's the recommended way to prevent objects from being garbage collected?
For example, I create a wxImageList and pass it to wxNotebook::SetImageList().
As wxNotebook::SetImageList() doesn't take ownership of the list it could
happen that the garbage collector kills the wxImageList that I passed to 
SetImageList().
To prevent it from being collected I could assign the wxImageList to a global
variable but that doesn't look like a nice solution.... it would be nicer
if it were possible to reference the wxImageList somehow but I don't see
how this is possible. wxObject has a Ref() method but that doesn't seem to
be up for the job. 
Any hints?
-- 
Best regards,
 Andreas Falkenhahn mailto:an...@fa...
From: Paul K <pau...@ya...> - 2013年11月17日 07:58:23
Hi Kent,
I just compiled my wxlua based application with wxwidgets 3.0 couple
of days ago and haven't seen any issues/crashes yet. I'll try to run
the samples tomorrow (don't have access to my MacBook right now) to
check if there are any issues with them.
> - Is this setup supposed to work at all, i.e. wxLua with wxWindows 3?
I'd say so. I've been using wxwidgets 2.9.5 for several months and
have compiled/run wxwidgets 3.0 (including different pre-release
versions) without issues.
> How do I run the samples on OS X? I don't have a "wxLua" exe, but a
> "wxLua.app". I tried "open -a wxLua bindings.wx.lua" when this
> still did not crash, but the sample program argument seemed to be
> ignored.
You should be able to pass parameters after "--args", so it should probably be:
open -a wxLua --args bindings.wx.lua
You should also be able to use a "normal" lua interpreter and
libwx.dylib (or whatever the default name for wxlua library is).
Paul
ZeroBrane Studio - slick Lua IDE/editor/debugger for Windows, OSX, and
Linux - http://studio.zerobrane.com/
On Sat, Nov 16, 2013 at 5:11 PM, Kent Boortz <ken...@or...> wrote:
>
> Hi,
>
> I tried compile from source and run wxWindows 3.0.0, wxLua 2.8.12.3 on
> OS X 10.8.5 (XCode 5.0.2). The actual compile went fine
>
> cd wxWidgets-3.0.0
> ./configure --prefix=/usr/local
> make
> sudo make install
> cd ../wxLua-2.8.12.3-src
> mkdir obj ; cd obj
> cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ..
> make
> sudo make install
>
> I'm a bit puzzled how to run the samples, but for some minutes doing
> "open -a wxLua" kind of did work. It did display some sort of
> editor/debugger or something (I could not figure out how to run the
> samples from it). But then running "wxLua" stopped working and crash
> each time I try run it. Crash report for the crashing thread included
> below.
>
> My questions are
>
> - Is this setup supposed to work at all, i.e. wxLua with wxWindows 3?
>
> - If supposed to work, did I configure it wrong?
>
> - If not supposed to work, any hope of a wxLua that works with
> wxWindwows 3 any time soon?
>
> - How do I run the samples on OS X? I don't have a "wxLua" exe, but a
> "wxLua.app". I tried "open -a wxLua bindings.wx.lua" when this
> still did not crash, but the sample program argument seemed to be
> ignored.
>
> kent
>
>
> Process: wxLua [64176]
> Path: /Users/USER/*/wxLua.app/Contents/MacOS/wxLua
> Identifier: ???
> Version: 2.8.12.3 (2.8.12.3)
> Code Type: X86-64 (Native)
> Parent Process: launchd [212]
> User ID: 501
>
> Date/Time: 2013年11月17日 02:00:18.564 +0100
> OS Version: Mac OS X 10.8.5 (12F45)
> Report Version: 10
>
> Interval Since Last Report: 1434861 sec
> Crashes Since Last Report: 13
> Per-App Interval Since Last Report: 181 sec
> Per-App Crashes Since Last Report: 10
> Anonymous UUID: 344778B4-77CB-BE9D-2088-1E8765A77BDC
>
> Crashed Thread: 0 Dispatch queue: com.apple.main-thread
>
> Exception Type: EXC_BAD_ACCESS (SIGSEGV)
> Exception Codes: KERN_INVALID_ADDRESS at 0xfffffffffffffff8
>
> VM Regions Near 0xfffffffffffffff8:
> --> shared memory 00007ffffff3b000-00007ffffff3c000 [ 4K] r-x/r-x SM=SHM
>
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0 libwx_baseu-3.0.dylib 0x000000010da5332f (anonymous namespace)::wxFileSystemObjectExists(wxString const&, int) + 367
> 1 libwx_baseu-3.0.dylib 0x000000010da53139 wxFileName::FileExists() const + 57
> 2 libwx_baseu-3.0.dylib 0x000000010da23f36 wxFileConfig::Init() + 1718
> 3 libwx_baseu-3.0.dylib 0x000000010da2a658 wxFileConfig::wxFileConfig(wxString const&, wxString const&, wxString const&, wxString const&, long, wxMBConv const&) + 1128
> 4 libwxlua_bind-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c08ea03 wxLua_wxFileConfig_constructor(lua_State*) + 499 (wxbase_config.cpp:877)
> 5 libwxlua-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c8f0479 wxlua_callOverloadedFunction(lua_State*) + 233 (wxlbind.cpp:434)
> 6 libwxlua-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c8f1323 wxlua_wxLuaBindMethod_table__call(lua_State*) + 35 (wxlbind.cpp:350)
> 7 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b7ece luaD_precall + 1006 (ldo.c:320)
> 8 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9cad3d luaV_execute + 7613 (lvm.c:591)
> 9 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b8712 luaD_call + 178 (ldo.c:379)
> 10 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b1a5f f_call + 47 (lapi.c:801)
> 11 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b7569 luaD_rawrunprotected + 105 (ldo.c:119)
> 12 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b8b7a luaD_pcall + 122 (ldo.c:464)
> 13 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b19de lua_pcall + 174 (lapi.c:821)
> 14 libwxlua-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c90f84f wxLuaState::LuaPCall(int, int) + 255 (wxlstate.cpp:2988)
> 15 libwxlua-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c90fe2f wxLuaState::RunBuffer(char const*, unsigned long, wxString const&, int) + 479 (wxlstate.cpp:2938)
> 16 0x000000010be89d44 wxLuaStandaloneApp::OnInit() + 4292 (wxlua.cpp:294)
> 17 libwx_osx_cocoau_core-3.0.dylib 0x000000010d2f29a4 wxApp::CallOnInit() + 68
> 18 libwx_baseu-3.0.dylib 0x000000010da6fba7 wxEntry(int&, wchar_t**) + 119
> 19 0x000000010be88ab6 main + 38 (wxlua.cpp:118)
> 20 libdyld.dylib 0x00007fff8dccc7e1 start + 1
>
>
> --
> Kent Boortz, Release Staff engineer
> Oracle, The MySQL Team
> Mobile: +46 76 77 69 049
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> wxlua-users mailing list
> wxl...@li...
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
From: Kent B. <ken...@or...> - 2013年11月17日 01:11:42
Hi,
I tried compile from source and run wxWindows 3.0.0, wxLua 2.8.12.3 on
OS X 10.8.5 (XCode 5.0.2). The actual compile went fine
 cd wxWidgets-3.0.0
 ./configure --prefix=/usr/local
 make
 sudo make install
 cd ../wxLua-2.8.12.3-src
 mkdir obj ; cd obj
 cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ..
 make
 sudo make install
I'm a bit puzzled how to run the samples, but for some minutes doing
"open -a wxLua" kind of did work. It did display some sort of
editor/debugger or something (I could not figure out how to run the
samples from it). But then running "wxLua" stopped working and crash
each time I try run it. Crash report for the crashing thread included
below.
My questions are
 - Is this setup supposed to work at all, i.e. wxLua with wxWindows 3? 
 - If supposed to work, did I configure it wrong?
 - If not supposed to work, any hope of a wxLua that works with
 wxWindwows 3 any time soon?
 - How do I run the samples on OS X? I don't have a "wxLua" exe, but a
 "wxLua.app". I tried "open -a wxLua bindings.wx.lua" when this
 still did not crash, but the sample program argument seemed to be
 ignored.
kent
Process: wxLua [64176]
Path: /Users/USER/*/wxLua.app/Contents/MacOS/wxLua
Identifier: ???
Version: 2.8.12.3 (2.8.12.3)
Code Type: X86-64 (Native)
Parent Process: launchd [212]
User ID: 501
Date/Time: 2013年11月17日 02:00:18.564 +0100
OS Version: Mac OS X 10.8.5 (12F45)
Report Version: 10
Interval Since Last Report: 1434861 sec
Crashes Since Last Report: 13
Per-App Interval Since Last Report: 181 sec
Per-App Crashes Since Last Report: 10
Anonymous UUID: 344778B4-77CB-BE9D-2088-1E8765A77BDC
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xfffffffffffffff8
VM Regions Near 0xfffffffffffffff8:
--> shared memory 00007ffffff3b000-00007ffffff3c000 [ 4K] r-x/r-x SM=SHM 
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libwx_baseu-3.0.dylib 0x000000010da5332f (anonymous namespace)::wxFileSystemObjectExists(wxString const&, int) + 367
1 libwx_baseu-3.0.dylib 0x000000010da53139 wxFileName::FileExists() const + 57
2 libwx_baseu-3.0.dylib 0x000000010da23f36 wxFileConfig::Init() + 1718
3 libwx_baseu-3.0.dylib 0x000000010da2a658 wxFileConfig::wxFileConfig(wxString const&, wxString const&, wxString const&, wxString const&, long, wxMBConv const&) + 1128
4 libwxlua_bind-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c08ea03 wxLua_wxFileConfig_constructor(lua_State*) + 499 (wxbase_config.cpp:877)
5 libwxlua-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c8f0479 wxlua_callOverloadedFunction(lua_State*) + 233 (wxlbind.cpp:434)
6 libwxlua-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c8f1323 wxlua_wxLuaBindMethod_table__call(lua_State*) + 35 (wxlbind.cpp:350)
7 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b7ece luaD_precall + 1006 (ldo.c:320)
8 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9cad3d luaV_execute + 7613 (lvm.c:591)
9 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b8712 luaD_call + 178 (ldo.c:379)
10 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b1a5f f_call + 47 (lapi.c:801)
11 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b7569 luaD_rawrunprotected + 105 (ldo.c:119)
12 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b8b7a luaD_pcall + 122 (ldo.c:464)
13 libwxlua_lua51-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c9b19de lua_pcall + 174 (lapi.c:821)
14 libwxlua-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c90f84f wxLuaState::LuaPCall(int, int) + 255 (wxlstate.cpp:2988)
15 libwxlua-wxosx_cocoaud-2.8.12.3.dylib 0x000000010c90fe2f wxLuaState::RunBuffer(char const*, unsigned long, wxString const&, int) + 479 (wxlstate.cpp:2938)
16 0x000000010be89d44 wxLuaStandaloneApp::OnInit() + 4292 (wxlua.cpp:294)
17 libwx_osx_cocoau_core-3.0.dylib 0x000000010d2f29a4 wxApp::CallOnInit() + 68
18 libwx_baseu-3.0.dylib 0x000000010da6fba7 wxEntry(int&, wchar_t**) + 119
19 0x000000010be88ab6 main + 38 (wxlua.cpp:118)
20 libdyld.dylib 0x00007fff8dccc7e1 start + 1
-- 
Kent Boortz, Release Staff engineer
Oracle, The MySQL Team
Mobile: +46 76 77 69 049
From: Andreas F. <an...@fa...> - 2013年11月15日 22:41:54
On 15.11.2013 at 23:37 John Labenski wrote:
> On Fri, Nov 15, 2013 at 5:34 PM, Andreas Falkenhahn <an...@fa...>wrote:
> 
> On 15.11.2013 at 23:28 John Labenski wrote:
> 
 >> You are supposed to use myButton:Destroy() to let wxWidgets
 >> properly delete it. The delete() function is available only for
 >> objects that are not owned by something else. It works on wxRects
 >> for example, but all wxWindows are supposed to be owned by their parent.
> 
> Ok, but is myButton:Destroy() really equivalent to doing a "delete myButton"
> in C++? I ask because I'm porting some C++ code to wxLua and the code
> often deletes and then re-creates the button and I'm trying to imitate
> this behaviour in wxLua....
> 
> Your C++ code is doing the wrong thing, the wxWidgets manual
> explicitly ask you to use Destroy() and not delete. You can call
> Show(false) if you want to make sure it is immediately hidden from the user (if necessary).
> 
> http://docs.wxwidgets.org/trunk/classwx_window.html#a6bf0c5be864544d9ce0560087667b7fc
Ok.... but it's strange that the code I'm talking about is actually official example code
by the wxWidgets authors! I'm talking about the Widgets Demo from this page:
http://www.wxwidgets.org/downloads/demos.htm
(second demo from the top)
It uses delete on the objects all the time... strange...
-- 
Best regards,
 Andreas Falkenhahn mailto:an...@fa...
From: John L. <jla...@gm...> - 2013年11月15日 22:37:39
On Fri, Nov 15, 2013 at 5:34 PM, Andreas Falkenhahn
<an...@fa...>wrote:
> On 15.11.2013 at 23:28 John Labenski wrote:
>
> > You are supposed to use myButton:Destroy() to let wxWidgets
> > properly delete it. The delete() function is available only for
> > objects that are not owned by something else. It works on wxRects
> > for example, but all wxWindows are supposed to be owned by their parent.
>
> Ok, but is myButton:Destroy() really equivalent to doing a "delete
> myButton"
> in C++? I ask because I'm porting some C++ code to wxLua and the code
> often deletes and then re-creates the button and I'm trying to imitate
> this behaviour in wxLua....
>
>
Your C++ code is doing the wrong thing, the wxWidgets manual explicitly ask
you to use Destroy() and not delete. You can call Show(false) if you want
to make sure it is immediately hidden from the user (if necessary).
http://docs.wxwidgets.org/trunk/classwx_window.html#a6bf0c5be864544d9ce0560087667b7fc
Regards,
 John

Showing results of 30

1 2 > >> (Page 1 of 2)
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 によって変換されたページ (->オリジナル) /