Advertisement
Guest User

Untitled

a guest
Jul 7th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.67 KB | None | 0 0
  1. -module(gui_functions).
  2. -export([startGUI/0]).
  3. -include("params.hrl").
  4. -include_lib("wx/include/wx.hrl").
  5.  
  6.  
  7. startGUI() ->
  8.     Wx = wx:new(),
  9.     Frame = wxFrame:new(Wx, -1, "Cars", [{size, {?Max_x, ?Max_y}}]),
  10.     Panel = wxPanel:new(Frame),
  11.     wxWindow:setBackgroundColour(Panel, {11,11,211}),
  12.    
  13.     GrassPanel = wxPanel:new(Panel,250,0,700,600),
  14.     GrassPic = wxBitmap:new(wxImage:scale(wxImage:new("gui/grass.jpg"),700,600)),
  15.    
  16.     Paint = wxPaintDC:new(GrassPanel), % THIS LINE IS PROBLEMATIC, IT TERMINATES THE WX PROCESS
  17.     wxDC:drawBitmap(Paint, GrassPic, {0,0}),
  18.     wxPaintDC:destroy(Paint),
  19.    
  20.     wxFrame:connect(Frame, command_menu_selected),
  21.     wxFrame:show(Frame).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement