|
From: Ryan P. <rpu...@gm...> - 2007-01-22 14:58:31
|
I can't seem to set the icon for the frame in wxLua. I really want to do this when it is frozen with wxluafreeze. But I can't seem to get the SetIcon() to work at all. A small example would be great. Thanks -- Regards, Ryan RJP Computing |
|
From: Hakki D. <dog...@tr...> - 2007-01-22 15:08:32
|
Hi,
Ryan Pusztai yazmış:
> I can't seem to set the icon for the frame in wxLua. I really want to do
> this when it is frozen with wxluafreeze. But I can't seem to get the
> SetIcon() to work at all. A small example would be great. Thanks
> --
> Regards,
> Ryan
> RJP Computing
>
>
(I don't know whether it is different for wxluafreeze but,)
I'm using like:
local bitmap = GetImage("dsbw")
local icon = wx.wxDefaultIcon()
icon:CopyFromBitmap(bitmap)
app.frame:SetIcon(icon)
bitmap:Delete()
icon:Delete()
Taken from wxLua's samples
--
Regards,
Hakki Dogusan
|
|
From: Ryan P. <rpu...@gm...> - 2007-01-22 18:28:14
|
On 1/22/07, Hakki Dogusan <dog...@tr...> wrote:
>
> Hi,
>
> (I don't know whether it is different for wxluafreeze but,)
>
> I'm using like:
>
> local bitmap = GetImage("dsbw")
> local icon = wx.wxDefaultIcon()
> icon:CopyFromBitmap(bitmap)
> app.frame:SetIcon(icon)
> bitmap:Delete()
> icon:Delete()
>
> Taken from wxLua's samples
>
This was close, but I still can't get the frame icon to change. I can use
the bitmap created by the code above in a wxBitmapButton, but nothing
happens to the frame icon. I also tried to wxLua smaples that set the frames
icon and they didn't work either. The samples are wxluasudoku.wx.lua and
calculator.wx.lua.
--
Regards,
Ryan
RJP Computing
|
|
From: Hakki D. <dog...@tr...> - 2007-01-22 19:10:37
|
Hi,
Ryan Pusztai wrote:
>
>
> On 1/22/07, *Hakki Dogusan* <dog...@tr... <mailto:dog...@tr...>>
> wrote:
>
> Hi,
>
> (I don't know whether it is different for wxluafreeze but,)
>
> I'm using like:
>
> local bitmap = GetImage("dsbw")
> local icon = wx.wxDefaultIcon()
> icon:CopyFromBitmap(bitmap)
> app.frame:SetIcon(icon)
> bitmap:Delete()
> icon:Delete()
>
> Taken from wxLua's samples
>
>
> This was close, but I still can't get the frame icon to change. I can
> use the bitmap created by the code above in a wxBitmapButton, but
> nothing happens to the frame icon. I also tried to wxLua smaples that
> set the frames icon and they didn't work either. The samples are
> wxluasudoku.wx.lua and calculator.wx.lua.
> --
> Regards,
> Ryan
> RJP Computing
>
>
Could it be a size/image/etc. problem?
My "dsbw" icon is a xpm file generated
from a real icon.
Related code follows:
local dsbw_xpm = {
"32 32 12 1",
" c None",
". c Blue",
"X c DarkSlateGray",
"o c Yellow",
"O c Red",
"+ c Gray60",
"@ c #999900",
"# c Gray100",
"$ c Cyan",
"% c #990099",
"& c Gray80",
"* c Green",
" . ",
" XX X. ",
" XX X ",
" XX o . ",
" XX O + X ",
" XX O@O +#+ . ",
" XX O@o@O + X ",
" XX O@o#o@O . . ",
" X X O@o@O .$. X ",
" X X O@O .$#$. . ",
" X X O O .$. XX ",
" X X OoO . XX. ",
" XX X O XX+X ",
" XXoX X % XX++++. ",
"X#oooX X XX++++&#XX ",
"Xo#oooX X XX++++&#XX. ",
"Xoo#oooX XXX++++&XXXoX*X ",
"Xooo#oooX X++++&XXooooXX*. ",
" Xooo#oooX X++&XXooooXXX***X ",
" Xooo#oooXX&XXooooXX+X*****. ",
" Xooo#oooXXooooXX++++X*****X ",
" Xooo#ooooooXX++++&#XX****X. ",
" Xooo#oooXX++++&#XX****X. ",
" Xooo#XX++++&#XX****XX+. ",
" XooX++++&#XX****XX++++X ",
" XoX++&#XX****XX++++&&X. ",
" XX&#XXXX**XX++++&#X. ",
" XXXX**XXX++++&#X. ",
" X**X++++&#X. ",
" X*X++&#X. ",
" XX&#X. ",
" XX. "}
-----------------------------------------------------------------------------
function GetImage(name)
if name == "dsbw" then
return wx.wxBitmapFromXPMData(dsbw_xpm)
elseif name == "add" then
return wx.wxBitmapFromXPMData(add_xpm)
elseif name == "cancel" then
return wx.wxBitmapFromXPMData(cancel_xpm)
elseif name == "delete" then
return wx.wxBitmapFromXPMData(delete_xpm)
elseif name == "ok" then
return wx.wxBitmapFromXPMData(ok_xpm)
else
error("unknown image name")
end
end
-----------------------------------------------------------------------------
--
Regards,
Hakki Dogusan
|
|
From: Ryan P. <rpu...@gm...> - 2007-01-22 19:37:32
|
On 1/22/07, Hakki Dogusan <dog...@tr...> wrote: > > Hi, > > Could it be a size/image/etc. problem? > My "dsbw" icon is a xpm file generated > from a real icon. > > Related code follows: > ... > Well thanks I found it was the size of my xmp. I made it 32x32 and BAM it worked. I am really enjoying my wxLua experiance. It is fun to write a little script and see the GUI right away. Fun!!!! Thanks for you help. -- Regards, Ryan RJP Computing |
|
From: John L. <jla...@gm...> - 2007-01-22 19:19:41
|
On 1/22/07, Ryan Pusztai <rpu...@gm...> wrote:
> On 1/22/07, Hakki Dogusan <dog...@tr...> wrote:
> > Hi,
> >
> > (I don't know whether it is different for wxluafreeze but,)
> >
> > I'm using like:
> >
> > local bitmap = GetImage("dsbw")
> > local icon = wx.wxDefaultIcon()
> > icon:CopyFromBitmap(bitmap)
> > app.frame:SetIcon(icon)
> > bitmap:Delete()
> > icon:Delete()
> >
> > Taken from wxLua's samples
>
> This was close, but I still can't get the frame icon to change. I can use
> the bitmap created by the code above in a wxBitmapButton, but nothing
> happens to the frame icon. I also tried to wxLua smaples that set the frames
> icon and they didn't work either. The samples are wxluasudoku.wx.lua and
> calculator.wx.lua.
I've noticed that it doesn't change too, under MSW, but couldn't
understand why, since it works in GTK.
Ahhh, I just discovered that you need to use a 32x32 bit XPM file or
load a 32x32 ico from disk in MSW.
If you want to change the icon that is displayed in windows explorer
you have to change the icon in the wxluafreeze.rc resource file and
recompile. I found these programs that I think should be able to
change the icon of a precompiled executable, but I haven't tested
either.
http://www.angusj.com/resourcehacker/
http://www.wilsonc.demon.co.uk/d10resourceeditor.htm
Hope this helps,
John Labenski
|
|
From: Ryan P. <rpu...@gm...> - 2007-01-22 19:39:32
|
On 1/22/07, John Labenski <jla...@gm...> wrote: > > I've noticed that it doesn't change too, under MSW, but couldn't > understand why, since it works in GTK. > > Ahhh, I just discovered that you need to use a 32x32 bit XPM file or > load a 32x32 ico from disk in MSW. I just found this as well. The icon I was trying to load from file had multiple icons and sizes in it and it didn't like that either. If you want to change the icon that is displayed in windows explorer > you have to change the icon in the wxluafreeze.rc resource file and > recompile. I found these programs that I think should be able to > change the icon of a precompiled executable, but I haven't tested > either. > > http://www.angusj.com/resourcehacker/ > http://www.wilsonc.demon.co.uk/d10resourceeditor.htm Great. I will look into that. -- Regards, Ryan RJP Computing |