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





Showing 21 results of 21

On Fri, Nov 20, 2009 at 9:14 AM, Mark Rushakoff
<MRu...@la...> wrote:
>
> One strange thing is that if I do not use the normal method of creating a button (`b = wx.wxButton(panel, wx.wxID_ANY, "fsdafsdafds")`), but I instead do `b = wx.wxButton(); b:Create(panel, wx.wxID_ANY); b:SetLabel("fdsffsdfsdaf")`, the x,y,w,h are all correct. Once again, the other widgets are placed correctly around it, but `b` is not rendered, even if I do an explicit `b:Show(true)`. `b:IsShown()` also returns true. I can even get a tooltip on `b`, but I cannot seem to render the button or click on it. Maybe I'm just missing some other, obvious method call?
>
I still suspect something off about your program or build since such a
small change in code should not make any difference at all. I still
suggest trying to compile and run wxLuaFreeze.exe (see below). At
first glance the C++ program you posted looks ok, but one more thing
to try is to rem out the lines below and see if it works. I tried to
make eliminating wxLua libs work, but maybe there is a problem with my
implementation. In any case, these defines are supposed to be set when
you compile the wxLua libs *and* your app, but I don't see why it
would matter.
 #define wxLUA_USEBINDING_WXHTML 0
 #define wxLUA_USEBINDING_WXNET 0
 #define wxLUA_USEBINDING_WXLUASOCKET 0
 #define wxLUA_USEBINDING_WXSTC 0
> I actually haven't been able to build any of the wxLua* apps; I'm using makefile.vc with VS2008 Express for the build process, with a Unicode Release, static libraries, static runtimes, and it looks like the Lua libraries are always built with the /MD flag when they should be /MT (at least in this case). I'm not sure if this is something I'm doing wrong or if it's a Bakefile issue.
>
I didn't know this. I have used makefile.vc with Visual Studio 6
without error or warning. If you merely change it to /MT can you
compile the wxLua.exe and wxLuaFreeze.exe apps and test your program?
I will try this with VC6 and make the change if it works for both.
>> One thing I noticed in Mark's code: Is there a reason to 'require
>> ("wx")' if the wx is initialized in C++ code? I am just this could
>> lead to some kind of double initialization? (I don't use require wx in
>> my scripts)
>
> I have removed it, and it doesn't seem to have made a difference.
This does not matter since wxLua checks to see if it was installed and
does nothing if called twice. The line exists in all the sample
programs so that they can be run with lua.exe and the wx.dll or the
statically compiled wxlua.exe or wxluafreeze.exe.
Regards,
 John
On Fri, Nov 20, 2009 at 4:14 PM, Mark Rushakoff
<MRu...@la...> wrote:
>
> I actually haven't been able to build any of the wxLua* apps; I'm using makefile.vc with VS2008 Express for the build process, with a Unicode Release, static libraries, static runtimes, and it looks like the Lua libraries are always built with the /MD flag when they should be /MT (at least in this case). I'm not sure if this is something I'm doing wrong or if it's a Bakefile issue.
>
I think I did some changes to makefile.vc so that I could get the
configuration I wanted. I actually compile the debug build using dll
multithreaded libraries, and the release build with static
multithreaded libraries. I guess I could update to the latest version,
and extract my changes. (I don't use Unicode at the moment though)
For Lua itself I compile it as part of my application, I don't use the
version from the wxLua directories, except as wxLua itself uses it
during the compilation.
 Eero
 
> > So it looks like Lua is placing the X and the Width out in Never-Never Land, but the Y and Height are fine.
> You have something seriously wrong with your build I believe. Even your C++ created controls are all wrong. The position and size values should be in pixels from the upper left corner of the window.
I made a stupid copy-paste error when I tested that -- I was grabbing the Y and Height from the Lua button both times. The C++ Y/Height are as they should be: X,Y = (0,0); W,H = (75,23) or thereabout. The wxLua button has all enormous (and apparently incorrect) values.
One strange thing is that if I do not use the normal method of creating a button (`b = wx.wxButton(panel, wx.wxID_ANY, "fsdafsdafds")`), but I instead do `b = wx.wxButton(); b:Create(panel, wx.wxID_ANY); b:SetLabel("fdsffsdfsdaf")`, the x,y,w,h are all correct. Once again, the other widgets are placed correctly around it, but `b` is not rendered, even if I do an explicit `b:Show(true)`. `b:IsShown()` also returns true. I can even get a tooltip on `b`, but I cannot seem to render the button or click on it. Maybe I'm just missing some other, obvious method call?
> I recommend cleaning everything and rebuilding from scratch. You should also run your Lua program that prints out the positions of the windows in wxLua or wxLuaFreeze to see if you have the problem there.
I have rebuilt from scratch several times.
I actually haven't been able to build any of the wxLua* apps; I'm using makefile.vc with VS2008 Express for the build process, with a Unicode Release, static libraries, static runtimes, and it looks like the Lua libraries are always built with the /MD flag when they should be /MT (at least in this case). I'm not sure if this is something I'm doing wrong or if it's a Bakefile issue.
> One thing I noticed in Mark's code: Is there a reason to 'require
> ("wx")' if the wx is initialized in C++ code? I am just this could
> lead to some kind of double initialization? (I don't use require wx in
> my scripts)
I have removed it, and it doesn't seem to have made a difference.
I have myself used the single executable solution for years, Which
means my startup code has probably acquired too much of historical
cruft... but anyways it certainly does work.
One thing I noticed in Mark's code: Is there a reason to 'require
("wx")' if the wx is initialized in C++ code? I am just this could
lead to some kind of double initialization? (I don't use require wx in
my scripts)
 Eero
On Thu, Nov 19, 2009 at 3:01 PM, Mark Rushakoff
<MRu...@la...> wrote:
>
> What I'm doing now -- and this is certainly one of the uglier hacks I've done -- is I'm creating widgets in C++, and passing the widget's ID to Lua; then, in Lua, I'm using FindWindowById and DynamicCast, and the widgets are placed correctly.
>
> When I place a "C++" button side-by-side with a "Lua" (invisible) button, I get
>
> C++ X,Y:         0, 1241184
> C++ Width, Height:   75, -1241176
>
> Lua X,Y:      1241152, 1241184
> Lua Width, Height: 3261761, -1241176
>
> So it looks like Lua is placing the X and the Width out in Never-Never Land, but the Y and Height are fine.
You have something seriously wrong with your build I believe. Even
your C++ created controls are all wrong. The position and size values
should be in pixels from the upper left corner of the window.
I recommend cleaning everything and rebuilding from scratch. You
should also run your Lua program that prints out the positions of the
windows in wxLua or wxLuaFreeze to see if you have the problem there.
Regards,
 John
>This is strange indeed. You do two things in your C++ program that
>aren't necessary and may/should cause problems.
>This statement should not even compile as wxLuaState::Create() returns a bool.
>m_wxlState = m_wxlState.Create(this);
You're right; I'm not sure why that worked, but I changed it to just `m_wxlState.Create(this)` and it is working the same.
>This is not necessary as wxLua does this already, but it may be harmless.
>luaL_openlibs(L);
I took that out, same behavior... Seems to be harmless.
>You should do some simple debugging like printing the position and
>size of the wxButton to make sure that it really was created and does
>not have a zero size.
What I'm doing now -- and this is certainly one of the uglier hacks I've done -- is I'm creating widgets in C++, and passing the widget's ID to Lua; then, in Lua, I'm using FindWindowById and DynamicCast, and the widgets are placed correctly.
When I place a "C++" button side-by-side with a "Lua" (invisible) button, I get
C++ X,Y: 0, 1241184
C++ Width, Height: 75, -1241176
Lua X,Y: 1241152, 1241184
Lua Width, Height: 3261761, -1241176
So it looks like Lua is placing the X and the Width out in Never-Never Land, but the Y and Height are fine.
I'm going to continue with the hack-y way of things right now, since I'm running behind schedule a bit. If I figure out any kind of fix, I'll post back.
This is strange indeed. You do two things in your C++ program that
aren't necessary and may/should cause problems.
This statement should not even compile as wxLuaState::Create() returns a bool.
m_wxlState = m_wxlState.Create(this);
This is not necessary as wxLua does this already, but it may be harmless.
luaL_openlibs(L);
You should do some simple debugging like printing the position and
size of the wxButton to make sure that it really was created and does
not have a zero size.
Finally, please look at the wxLuaFreeze app which is the simplest
incarnation of initializing wxLua in a C++ app.
Regards,
 John
On Thu, Nov 19, 2009 at 8:25 AM, Mark Rushakoff
<MRu...@la...> wrote:
> I already asked this question on StackOverflow (http://stackoverflow.com/questions/1759366/embedded-wxlua-not-displaying-most-controls-but-still-does-layout-correctly), so I'm pretty much doing a copy-paste of it here. Feel free to duplicate any answers there if you've got an account.
>
> I am having trouble getting embedded wxLua to work with my application -- it works fine when I use the wxLua DLLs, but I'm trying to use the static libraries so I can distribute a single, standalone executable with no external dependencies.
>
> First, the symptoms: Most controls (such as wxButtons, wxGauges, wxTextCtrls) do not display; at the very least, wxStaticTexts display, and I can successfully use menus to show an about menu and to quit.
>
> Here's a simple test script:
>
>  require("wx")
>  frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "Frame")
>  panel = wx.wxPanel(frame, wx.wxID_ANY)
>  hbox = wx.wxBoxSizer(wx.wxHORIZONTAL)
>  hbox:Add(wx.wxButton(panel, wx.wxID_ANY, "I'm a button"))
>  hbox:Add(wx.wxStaticText(panel, wx.wxID_ANY, "Hello"))
>  panel:SetSizerAndFit(hbox)
>  frame:Show(true)
>  wx.wxGetApp():MainLoop()
>
> The top window in this screen shot shows a raw `lua file.lua` that calls the wx library, and the bottom one shows the result when run from my embedded wxLua:
>
> http://img337.imageshack.us/img337/8425/wxluaissue.png
>
> As you can see, the widgets that do show up get placed correctly, but the widgets that don't show up, neither get rendered nor process events.
>
> Here's the offending (minimalized) C++:
>
>  extern "C" {
>  #include "lua.h"
>  #include "lualib.h"
>  #include "lauxlib.h"
>  }
>  #include "wx/app.h"
>  #include "wx/image.h"
>
>  // disable some of the libraries we're didn't want
>  #define wxLUA_USEBINDING_WXHTML 0
>  #define wxLUA_USEBINDING_WXNET 0
>  #define wxLUA_USEBINDING_WXLUASOCKET 0
>  #define wxLUA_USEBINDING_WXSTC 0
>  #include "wxbind/include/wxbinddefs.h"
>  #include "wx/msgdlg.h"
>
>  WXLUA_DECLARE_BIND_ALL;
>
>  class MyApp : public wxApp
>  {
>    public:
>      virtual bool OnInit();
>      virtual int OnExit();
>      void OnLua(wxLuaEvent &e);
>      wxLuaState m_wxlState;
>    private:
>      DECLARE_EVENT_TABLE();
>  };
>
>  IMPLEMENT_APP(MyApp)
>
>  BEGIN_EVENT_TABLE(MyApp, wxApp)
>  EVT_LUA_ERROR      (wxID_ANY, MyApp::OnLua)
>  END_EVENT_TABLE()
>
>  bool MyApp::OnInit()
>  {
>    WXLUA_IMPLEMENT_BIND_ALL
>
>    wxInitAllImageHandlers();
>    wxLuaState::sm_wxAppMainLoop_will_run = true;
>    m_wxlState = m_wxlState.Create(this);
>    lua_State *L = m_wxlState.GetLuaState();
>
>    luaL_openlibs(L);
>    int res = luaL_dofile(L, "C:\\file.lua");
>    if (res != 0)
>    {
>      wxMessageBox(wxString::FromAscii(lua_tostring(L, -1)), wxT("Error running script"));
>      return false;
>    }
>
>    return true;
>  }
>
>  int MyApp::OnExit()
>  {
>    wxMessageBox(wxT("Goodbye!"));
>    m_wxlState.CloseLuaState(true);
>    m_wxlState.Destroy();
>    return wxApp::OnExit();
>  }
>
>  void MyApp::OnLua(wxLuaEvent &e)
>  {
>    wxMessageBox(e.GetString(), wxT("wxLua"));
>  }
>
> I have stripped down both wxWidgets and wxLua using their setup.h and wxluasetup.h files; I can succcessfully render buttons if I use wxWidgets in pure C++, so I think the issue is with either how I compiled wxLua, or how I'm configuring the wxLuaState.
>
> I think I've configured the wxLuaState correctly, but I haven't been able to find an example where all of the work is done in a luaL_dofile -- all the other examples have custom wx-derived classes, except for wxlua.cpp, which is a little different since it's for the wx.dll that Lua uses. I've spent several hours trying to figure out what I'm doing wrong, and I'm completely out of ideas at this point.
>
> Has anyone seen this issue before, or can anyone confirm or deny that I'm setting up the wxLuaState correctly?
>
> Mark
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> wxlua-users mailing list
> wxl...@li...
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
>
I already asked this question on StackOverflow (http://stackoverflow.com/questions/1759366/embedded-wxlua-not-displaying-most-controls-but-still-does-layout-correctly), so I'm pretty much doing a copy-paste of it here. Feel free to duplicate any answers there if you've got an account.
I am having trouble getting embedded wxLua to work with my application -- it works fine when I use the wxLua DLLs, but I'm trying to use the static libraries so I can distribute a single, standalone executable with no external dependencies.
First, the symptoms: Most controls (such as wxButtons, wxGauges, wxTextCtrls) do not display; at the very least, wxStaticTexts display, and I can successfully use menus to show an about menu and to quit.
Here's a simple test script:
 require("wx")
 frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "Frame")
 panel = wx.wxPanel(frame, wx.wxID_ANY)
 hbox = wx.wxBoxSizer(wx.wxHORIZONTAL)
 hbox:Add(wx.wxButton(panel, wx.wxID_ANY, "I'm a button"))
 hbox:Add(wx.wxStaticText(panel, wx.wxID_ANY, "Hello"))
 panel:SetSizerAndFit(hbox)
 frame:Show(true)
 wx.wxGetApp():MainLoop()
The top window in this screen shot shows a raw `lua file.lua` that calls the wx library, and the bottom one shows the result when run from my embedded wxLua: 
http://img337.imageshack.us/img337/8425/wxluaissue.png
As you can see, the widgets that do show up get placed correctly, but the widgets that don't show up, neither get rendered nor process events.
Here's the offending (minimalized) C++:
 extern "C" {
 #include "lua.h"
 #include "lualib.h"
 #include "lauxlib.h"
 }
 #include "wx/app.h"
 #include "wx/image.h"
 
 // disable some of the libraries we're didn't want
 #define wxLUA_USEBINDING_WXHTML 0
 #define wxLUA_USEBINDING_WXNET 0
 #define wxLUA_USEBINDING_WXLUASOCKET 0
 #define wxLUA_USEBINDING_WXSTC 0
 #include "wxbind/include/wxbinddefs.h"
 #include "wx/msgdlg.h"
 WXLUA_DECLARE_BIND_ALL;
 class MyApp : public wxApp
 {
 public:
 virtual bool OnInit();
 virtual int OnExit();
 void OnLua(wxLuaEvent &e);
 wxLuaState m_wxlState;
 private:
 DECLARE_EVENT_TABLE();
 };
 IMPLEMENT_APP(MyApp)
 BEGIN_EVENT_TABLE(MyApp, wxApp)
 EVT_LUA_ERROR (wxID_ANY, MyApp::OnLua)
 END_EVENT_TABLE()
 bool MyApp::OnInit()
 {
 WXLUA_IMPLEMENT_BIND_ALL
 wxInitAllImageHandlers();
 wxLuaState::sm_wxAppMainLoop_will_run = true;
 m_wxlState = m_wxlState.Create(this);
 lua_State *L = m_wxlState.GetLuaState();
 luaL_openlibs(L);
 int res = luaL_dofile(L, "C:\\file.lua");
 if (res != 0)
 {
 wxMessageBox(wxString::FromAscii(lua_tostring(L, -1)), wxT("Error running script"));
 return false;
 }
 return true;
 }
 int MyApp::OnExit()
 {
 wxMessageBox(wxT("Goodbye!"));
 m_wxlState.CloseLuaState(true);
 m_wxlState.Destroy();
 return wxApp::OnExit();
 }
 void MyApp::OnLua(wxLuaEvent &e)
 {
 wxMessageBox(e.GetString(), wxT("wxLua"));
 }
I have stripped down both wxWidgets and wxLua using their setup.h and wxluasetup.h files; I can succcessfully render buttons if I use wxWidgets in pure C++, so I think the issue is with either how I compiled wxLua, or how I'm configuring the wxLuaState.
I think I've configured the wxLuaState correctly, but I haven't been able to find an example where all of the work is done in a luaL_dofile -- all the other examples have custom wx-derived classes, except for wxlua.cpp, which is a little different since it's for the wx.dll that Lua uses. I've spent several hours trying to figure out what I'm doing wrong, and I'm completely out of ideas at this point.
Has anyone seen this issue before, or can anyone confirm or deny that I'm setting up the wxLuaState correctly?
Mark
From: Michael G. <sma...@ar...> - 2009年11月18日 17:09:49
In article <a84...@ma...>,
 John Labenski <jla...@gm...> wrote:
> On Wed, Nov 18, 2009 at 8:29 AM, Michael Gerbracht <sma...@ar...>
> wrote:
> > I am just trying to work with files in the xrc format. I did manage to
> > create a dialog, load it and display it. This works fine now. My problem
> > is that the dialog contains a wxChoice and I need to set the choice items
> > dynamically. Is there a way to do this?
> You should have a handle to the wxPanel or the dialog parent of the
> wxChoice and then you can use wxWindow::FindWindow(int id) to get the
> wxChoice as a wxWindow. Once you get the window you can use
> wxObject::DynamicCast("wxChoice") to turn the wxWindow into a wxChoice.
> http://docs.wxwidgets.org/stable/wx_wxwindow.html#wxwindowfindwindow
> local win = xrcPanel:FindWindow(unique_integer_id_of_the_wxchoice) 
> local choice = win:DynamicCast("wxChoice")
> choice:Insert("Hello", 0)
Thank you very much, I got it to work in the first attempt. Before I was
looking for wxChoice::Insert in the documentation but now I realised that
these commands are listed for wxControlWithItems and are valid for many
classes.
Thanks!
Michael
From: John L. <jla...@gm...> - 2009年11月18日 16:06:11
On Wed, Nov 18, 2009 at 8:29 AM, Michael Gerbracht <sma...@ar...> wrote:
> I am just trying to work with files in the xrc format. I did manage to create
> a dialog, load it and display it. This works fine now. My problem is that the
> dialog contains a wxChoice and I need to set the choice items dynamically. Is
> there a way to do this?
You should have a handle to the wxPanel or the dialog parent of the
wxChoice and then you can use wxWindow::FindWindow(int id) to get the
wxChoice as a wxWindow. Once you get the window you can use
wxObject::DynamicCast("wxChoice") to turn the wxWindow into a
wxChoice.
http://docs.wxwidgets.org/stable/wx_wxwindow.html#wxwindowfindwindow
local win = xrcPanel:FindWindow(unique_integer_id_of_the_wxchoice)
local choice = win:DynamicCast("wxChoice")
choice:Insert("Hello", 0)
Regards,
 John
From: Michael G. <sma...@ar...> - 2009年11月18日 13:29:43
I am just trying to work with files in the xrc format. I did manage to create
a dialog, load it and display it. This works fine now. My problem is that the
dialog contains a wxChoice and I need to set the choice items dynamically. Is
there a way to do this?
Thanks,
Michael
From: Dennis S. <den...@gm...> - 2009年11月18日 00:29:02
Thanks John - the Update() is exactly what I was missing. I didn't realize
wxAui would reparent the panels automatically.
Dennis
On Tue, Nov 17, 2009 at 4:48 PM, John Labenski <jla...@gm...> wrote:
> On Tue, Nov 17, 2009 at 6:13 PM, Dennis Sacks <den...@gm...>
> wrote:
> > I am building an XRC file with wxformbuilder - a frame and several panels
> at
> > the same level as the frame. I can get the frame successfully, but to get
> > the panels I find I have to pass the frame into the LoadPanel call, which
> > makes it display in the frame, which I don't want.
> > I want to have multiple panels that I add to a wxaui manager. Here is
> some
> > code that shows what I am attempting to do:
> > -- get frame
> > xmlResource:LoadFrame(frame,wx.NULL,"mainFrame")
> > frame.m_mgr = wxaui.wxAuiManager()
> > frame.m_mgr:SetManagedWindow(frame)
> >
> > -- when loadPanel is called, the panel shows up in my frame, which is
> what I
> > don't want.
> > topPanel = xmlResource:LoadPanel(frame,'topPanel')
>
> You are loading the panel to be a child of the frame, which is Ok for
> now since wxAui will reparent it when you add it below. All wxWindows
> must have some sort of parent at all times, except for top level
> windows like wxFrames and wxDialogs.
>
> > -- I want to add the panel here:
> >
> >
> frame.m_mgr:AddPane(topPanel,wxaui.wxAuiPaneInfo():Name("nav"):Caption("nav"):Top())
>
> This also looks Ok too. I'm no expert in wxAui, but I think you're
> missing the frame.m_mgr:Update() call to commit the changes.
>
> http://docs.wxwidgets.org/stable/wx_wxauimanager.html#wxauimanagerupdate
>
> Regards,
> John
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> wxlua-users mailing list
> wxl...@li...
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
>
From: John L. <jla...@gm...> - 2009年11月17日 23:49:04
On Tue, Nov 17, 2009 at 6:13 PM, Dennis Sacks <den...@gm...> wrote:
> I am building an XRC file with wxformbuilder - a frame and several panels at
> the same level as the frame. I can get the frame successfully, but to get
> the panels I find I have to pass the frame into the LoadPanel call, which
> makes it display in the frame, which I don't want.
> I want to have multiple panels that I add to a wxaui manager. Here is some
> code that shows what I am attempting to do:
> -- get frame
>  xmlResource:LoadFrame(frame,wx.NULL,"mainFrame")
>  frame.m_mgr = wxaui.wxAuiManager()
>  frame.m_mgr:SetManagedWindow(frame)
>
> -- when loadPanel is called, the panel shows up in my frame, which is what I
> don't want.
>  topPanel = xmlResource:LoadPanel(frame,'topPanel')
You are loading the panel to be a child of the frame, which is Ok for
now since wxAui will reparent it when you add it below. All wxWindows
must have some sort of parent at all times, except for top level
windows like wxFrames and wxDialogs.
> -- I want to add the panel here:
>
> frame.m_mgr:AddPane(topPanel,wxaui.wxAuiPaneInfo():Name("nav"):Caption("nav"):Top())
This also looks Ok too. I'm no expert in wxAui, but I think you're
missing the frame.m_mgr:Update() call to commit the changes.
http://docs.wxwidgets.org/stable/wx_wxauimanager.html#wxauimanagerupdate
Regards,
 John
From: Dennis S. <den...@gm...> - 2009年11月17日 23:14:05
I am building an XRC file with wxformbuilder - a frame and several panels at
the same level as the frame. I can get the frame successfully, but to get
the panels I find I have to pass the frame into the LoadPanel call, which
makes it display in the frame, which I don't want.
I want to have multiple panels that I add to a wxaui manager. Here is some
code that shows what I am attempting to do:
-- get frame
 xmlResource:LoadFrame(frame,wx.NULL,"mainFrame")
 frame.m_mgr = wxaui.wxAuiManager()
 frame.m_mgr:SetManagedWindow(frame)
-- when loadPanel is called, the panel shows up in my frame, which is what I
don't want.
 topPanel = xmlResource:LoadPanel(frame,'topPanel')
-- I want to add the panel here:
 frame.m_mgr:AddPane(topPanel,wxaui.wxAuiPaneInfo():Name("nav"):Caption("nav"):Top())
I'm guessing I'm going about this all wrong. Can someone give me some
suggestions? I appreciate it.
Dennis
From: Dzmitry H. <re...@tu...> - 2009年11月17日 09:03:18
Ouch.I thought it was an auxiliary file in order to once again do not
generate data types.
2009年11月16日 John Labenski <jla...@gm...>
> On Mon, Nov 16, 2009 at 4:28 AM, Dzmitry Hancharou <re...@tu...> wrote:
> > Hi.
> > I want to compile the wxluacan-project. If I leave line:
> > datatype_cache_input_fileTable = { "wx_datatypes.lua" }
> > in wxluacan_rules.lua, then everything works.
> > But if I delete wx_datatypes.lua I get the following errors:
>
> Why do you want to remove it? That file contains information for the
> binding generator to know what data types are available.
>
> Regards,
> John
>
>
> > 1>ERROR: Expected Parameter '=', ')', or ',' got Tag='&'. (Name=wxPen;
> > DataType=nil) File: './wxluacan.i':(line 12)
> > 1> ' void SetPen( const wxPen& pen )'
> > 1>ERROR: Expected Parameter '=', ')', or ',' got Tag='pen'. (Name=wxPen;
> > DataType=nil) File: './wxluacan.i':(line 12)
> > 1> ' void SetPen( const wxPen& pen )'
> > 1>ERROR: Expected Parameter '=', ')', or ',' got Tag='&'. (Name=wxBrush;
> > DataType=nil) File: './wxluacan.i':(line 13)
> > 1> ' void SetBrush( const wxBrush& brush )'
> > 1>ERROR: Expected Parameter '=', ')', or ',' got Tag='brush'.
> (Name=wxBrush;
> > DataType=nil) File: './wxluacan.i':(line 13)
> > 1> ' void SetBrush( const wxBrush& brush )'
> > I am using wxLua 2.8.9
> > How do I fix them?
> >
> > Regards,
> > Dzmitry Hancharou
> >
> ------------------------------------------------------------------------------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> > trial. Simplify your report design, integration and deployment - and
> focus
> > on
> > what you do best, core application coding. Discover what's new with
> > Crystal Reports now. http://p.sf.net/sfu/bobj-july
> > _______________________________________________
> > wxlua-users mailing list
> > wxl...@li...
> > https://lists.sourceforge.net/lists/listinfo/wxlua-users
> >
> >
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> wxlua-users mailing list
> wxl...@li...
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
>
From: John L. <jla...@gm...> - 2009年11月16日 15:53:03
On Mon, Nov 16, 2009 at 4:28 AM, Dzmitry Hancharou <re...@tu...> wrote:
> Hi.
> I want to compile the wxluacan-project. If I leave line:
> datatype_cache_input_fileTable = { "wx_datatypes.lua" }
> in wxluacan_rules.lua, then everything works.
> But if I delete wx_datatypes.lua I get the following errors:
Why do you want to remove it? That file contains information for the
binding generator to know what data types are available.
Regards,
 John
> 1>ERROR: Expected Parameter '=', ')', or ',' got Tag='&'. (Name=wxPen;
> DataType=nil) File: './wxluacan.i':(line 12)
> 1>  '  void SetPen( const wxPen& pen )'
> 1>ERROR: Expected Parameter '=', ')', or ',' got Tag='pen'. (Name=wxPen;
> DataType=nil) File: './wxluacan.i':(line 12)
> 1>  '  void SetPen( const wxPen& pen )'
> 1>ERROR: Expected Parameter '=', ')', or ',' got Tag='&'. (Name=wxBrush;
> DataType=nil) File: './wxluacan.i':(line 13)
> 1>  '  void SetBrush( const wxBrush& brush )'
> 1>ERROR: Expected Parameter '=', ')', or ',' got Tag='brush'. (Name=wxBrush;
> DataType=nil) File: './wxluacan.i':(line 13)
> 1>  '  void SetBrush( const wxBrush& brush )'
> I am using wxLua 2.8.9
> How do I fix them?
>
> Regards,
> Dzmitry Hancharou
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> wxlua-users mailing list
> wxl...@li...
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
>
>
From: Dzmitry H. <re...@tu...> - 2009年11月16日 09:29:05
Hi.
I want to compile the wxluacan-project. If I leave line:
datatype_cache_input_fileTable = { "wx_datatypes.lua" }
in wxluacan_rules.lua, then everything works.
But if I delete wx_datatypes.lua I get the following errors:
1>ERROR: Expected Parameter '=', ')', or ',' got Tag='&'. (Name=wxPen;
DataType=nil) File: './wxluacan.i':(line 12)
1> ' void SetPen( const wxPen& pen )'
1>ERROR: Expected Parameter '=', ')', or ',' got Tag='pen'. (Name=wxPen;
DataType=nil) File: './wxluacan.i':(line 12)
1> ' void SetPen( const wxPen& pen )'
1>ERROR: Expected Parameter '=', ')', or ',' got Tag='&'. (Name=wxBrush;
DataType=nil) File: './wxluacan.i':(line 13)
1> ' void SetBrush( const wxBrush& brush )'
1>ERROR: Expected Parameter '=', ')', or ',' got Tag='brush'. (Name=wxBrush;
DataType=nil) File: './wxluacan.i':(line 13)
1> ' void SetBrush( const wxBrush& brush )'
I am using wxLua 2.8.9
How do I fix them?
Regards,
Dzmitry Hancharou
From: John L. <jla...@gm...> - 2009年11月04日 00:42:50
On Tue, Nov 3, 2009 at 4:12 PM, Mateusz Czaplinski <cza...@gm...> wrote:
...
>> creation code in a Lua table and call it as appropriate. Don't forget
>> to use wxWindow::Destroy() to delete the topmost old one and it will
>> take care of its children. On the other hand if you are creating
>> wxListCtrls with many items, that might be slowish and in that case I
>> would create the window and immediately call Show(false) to hide it.
>> Finally, you cannot reparent between top level windows if I remember
>> correctly.
>
> "Topmost old one"? Um, I'm not sure what you mean by that (unless
For example, you may have
f = wx.wxFrame(wx.NULL,...)
p = wx.wxPanel(f, ...)
t = wx.wxTextBox(p, ...)
c = wx.wxChoice(p, ...)
If you Destroy() the wxPanel p then it will delete both t and c for
you. The parent window takes ownership of its children and if you are
creating various layouts you need only Destroy() the 'topmost' window
that contains all the children you have created. I merely made this
comment since it can be easily overlooked.
Regards,
 John
From: Mateusz C. <cza...@gm...> - 2009年11月03日 21:13:00
On Tue, Nov 3, 2009 at 6:16 AM, John Labenski <jla...@gm...> wrote:
> On Mon, Nov 2, 2009 at 5:12 PM, Mateusz Czaplinski <cza...@gm...> wrote:
>> Hi,
>> I'm having troubles with the following reduced sample program. When I
>> [...]
>
> Top level windows such as wxFrames and wxDialogs do not require a
> parent, but ALL child windows absolutely must have a parent window at
> creation in order to set up the window hierarchy even if you plan to
> reparent it. This is a requirement of wxWidgets. Some windows allow
> for a two-step creation where you call the default constructor,
> wxWindow(), and then call myWindow:Create(parent, id...), but this is
> not particularly useful in a scripting language.
Ah, that makes it clear, thanks very much! I didn't manage to find any
info on the Internet, and unfortunately I often have trouble when I
try to find anything in the wxWidgets docs (actually, now I sometimes
use the wxLua reference as a base in wxWidgets research...). Hope that
some day they get it better...
>> I'm in strong need to use Reparent(), as I'd like to create widgets
>> first, and add them to the layout & proper parent later. In more
>
> The creation of windows is pretty fast and I would not bother to try
> to create windows ahead of time, but rather store the layout and
> creation code in a Lua table and call it as appropriate. Don't forget
> to use wxWindow::Destroy() to delete the topmost old one and it will
> take care of its children. On the other hand if you are creating
> wxListCtrls with many items, that might be slowish and in that case I
> would create the window and immediately call Show(false) to hide it.
> Finally, you cannot reparent between top level windows if I remember
> correctly.
"Topmost old one"? Um, I'm not sure what you mean by that (unless
you're referring to The Great Cthulhu ;P). But the idea of storing the
widgets creation code as closures sounds very nice, might let me leave
the code where it is, yet still postpone its realisation until I have
the parent window - thanks for the idea, I didn't think of that.
>> general terms, I'm setting up some classes and methods which would
>> make it easier to use wxLua, in an IUP-like way. I intend to share
>
> Sounds interesting, I don't know much about IUP, but I would be
> hesitant to try to force wxWidgets to behave like another toolkit.
> It's much easier to swim with a stream than against it.
There's not going to be much forcing, rather wrapping wxWidgets
objects construction in (hopefully) simpler, more intuitive and more
Lua-tonic structures, with the underlying widgets available in the
".wx" field whenever possible. But I don't want to do much
advertising; should I succeed, I'll show it; should I fail, then I
think there's no need to waste words now :)
Greetz
Mateusz Czaplinski
From: John L. <jla...@gm...> - 2009年11月03日 05:16:44
On Mon, Nov 2, 2009 at 5:12 PM, Mateusz Czaplinski <cza...@gm...> wrote:
> Hi,
> I'm having troubles with the following reduced sample program. When I
> set TEST=2, everything is OK, but with TEST=1, the "foo bar" text does
> not display (strangely, the frame size is calculated properly). I have
> also tried with a wxTextCtrl, with the same results.
>
> ---- BEGIN
> require "wx"
>
> frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "Example frame")
Top level windows such as wxFrames and wxDialogs do not require a
parent, but ALL child windows absolutely must have a parent window at
creation in order to set up the window hierarchy even if you plan to
reparent it. This is a requirement of wxWidgets. Some windows allow
for a two-step creation where you call the default constructor,
wxWindow(), and then call myWindow:Create(parent, id...), but this is
not particularly useful in a scripting language.
> TEST=1
> if TEST==1 then
>  text = wx.wxStaticText(wx.NULL, wx.wxID_ANY, "foo bar")
>  text:Reparent(frame)
> elseif TEST==2 then
>  text = wx.wxStaticText(frame, wx.wxID_ANY, "foo bar")
> end
...
>
> I'm in strong need to use Reparent(), as I'd like to create widgets
> first, and add them to the layout & proper parent later. In more
The creation of windows is pretty fast and I would not bother to try
to create windows ahead of time, but rather store the layout and
creation code in a Lua table and call it as appropriate. Don't forget
to use wxWindow::Destroy() to delete the topmost old one and it will
take care of its children. On the other hand if you are creating
wxListCtrls with many items, that might be slowish and in that case I
would create the window and immediately call Show(false) to hide it.
Finally, you cannot reparent between top level windows if I remember
correctly.
> general terms, I'm setting up some classes and methods which would
> make it easier to use wxLua, in an IUP-like way. I intend to share
Sounds interesting, I don't know much about IUP, but I would be
hesitant to try to force wxWidgets to behave like another toolkit.
It's much easier to swim with a stream than against it.
Regards,
 John
From: Mateusz C. <cza...@gm...> - 2009年11月02日 22:12:22
Hi,
I'm having troubles with the following reduced sample program. When I
set TEST=2, everything is OK, but with TEST=1, the "foo bar" text does
not display (strangely, the frame size is calculated properly). I have
also tried with a wxTextCtrl, with the same results.
---- BEGIN
require "wx"
frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "Example frame")
TEST=1
if TEST==1 then
 text = wx.wxStaticText(wx.NULL, wx.wxID_ANY, "foo bar")
 text:Reparent(frame)
elseif TEST==2 then
 text = wx.wxStaticText(frame, wx.wxID_ANY, "foo bar")
end
sizer = wx.wxBoxSizer(wx.wxVERTICAL)
sizer:Add(text, 0, wx.wxEXPAND, 0)
frame:SetSizer(sizer)
sizer:SetSizeHints(frame)
frame:Show()
wx.wxGetApp():MainLoop()
---- END
I'm not sure if the problem is with wxLua, or with wxWidgets in
general, but I'm not comfortable now to compile the whole wxWidgets +
write some simple program just to test this small functionality -
maybe someone with wx libs at hand and experience in wx programming
could set up such a sample quickly and report his results? I'd be very
thankful.
I'm in strong need to use Reparent(), as I'd like to create widgets
first, and add them to the layout & proper parent later. In more
general terms, I'm setting up some classes and methods which would
make it easier to use wxLua, in an IUP-like way. I intend to share
that with the community when it is a bit more useful, but if I were
not to use Reparent(), I'd have to change the internal code to a more
complicated approach. So if anyone could help me, I'd be very
grateful.
Greetings
Mateusz Czaplinski

Showing 21 results of 21

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