[erlang-questions] Wx Toolbars in Erlang

Hosszú Gábor gabre@REDACTED
Mon Jan 14 09:25:43 CET 2013


Hello,

I have started to implement a GUI for an Erlang software but I have  
some problems with Wx Toolbars. I googled it and searched in the Wx  
docs but found nothing so I think that it may be an Erlang Wx related  
problem (or I am doing something wrong).

I have a window and a toolbar in it which is created at the startup as  
it is shown and coded in the Erlang wx demo (my one has no tools on  
it). I have to add buttons to this toolbar dinamically and remove  
other buttons so I want to alter the whole toolbar dinamically. I have  
a function which is ran in those cases when I have to modify the  
toolbar:
my_fun() ->
     Frame = wx:typeCast(wxWindow:findWindowByName("win"), wxFrame),
     TB = wxFrame:getToolBar(Frame),
     BM = wxBitmap:new(...,[{type,?wxBITMAP_TYPE_JPEG}]),
     wxToolBar:addTool(TB, 1, "label", BM),
     wxToolBar:realize(TB).
(and the path at ... is correct and valid)
I have double checked that my fun is executed but nothing is added to  
the toolbar.
How can I solve this problem?

Regards,
Gabor





More information about the erlang-questions mailing list