Hi all,

I want to embed icons into an application by using resources under Windows.

I understand how to prepare a resource file with entries like
  ico_about ICON "sm-bitmaps/about.ico"
compile this file using windres (located in ghc-6.10.1/bin) and link the 
resulting object file with my application.

In my application code I can then e.g. associate the about-icon with the 
application like so:
  ico_about <- iconCreateLoad "ico_about" wxBITMAP_TYPE_ICO_RESOURCE (sz 
16 16)
  topLevelWindowSetIcon f ico_about

Now, this seems not to be possible yet for toolbar icons. The function 
"toolMenu" expects a file path argument, and there is no other function 
that accepts a bitmap instead. I therefore suggest extending the file 
Graphics.UI.WX.Menu.hs by an additional function:
  toolMenuFromBitmap :: ToolBar a -> MenuItem a -> String -> Bitmap b -> 
[Prop ToolBarItem] -> IO ToolBarItem
The signature of the present toolMenu function is:
  toolMenu :: ToolBar a -> MenuItem a -> String -> FilePath -> [Prop 
ToolBarItem] -> IO ToolBarItem
whose definition would then just reduce to
  toolMenu toolbar menuitem label bitmapPath props =
    withBitmapFromFile bitmapPath $ \bitmap -> toolMenuFromBitmap 
toolbar menuitem label bitmap props

Best regards,
Bernd

P.S. Unfortunately, I cannot define the function toolMenuFromBitmap in 
my application because the data constructor ToolBarItem is not exported 
from Menu!

------------------------------------------------------------------------------
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to