wxEuphoria - Menu Font

new topic     » topic index » view thread      » older message » newer message

I modified Menu-demo.exw program creating new fonts. The new fonts work well in another of the demo programs.

#!/home/matt/euphoria/bin/exu 
-- example8.exw 
-- 
-- This example places a menu in a window 
 
without warning 
 
include wxeu/wxeud.e 
 
object void 
 
global integer 
-- Courier new 9 point 
	euCNNorm9 = create( wxFont, {9,wxDEFAULT,wxNORMAL,wxNORMAL,0,"Courier New"}),   
-- more here Bold, Italics, Underlined etc 
-- Courier new 10 point 
	euCNNorm10 = create( wxFont, {10,wxDEFAULT,wxNORMAL,wxNORMAL,0,"Courier New"}), 
-- more here Bold, Italics, Underlined etc 
-- Times New Roman 9 point 
	euTNRNorm9 = create( wxFont, {9,wxROMAN,wxNORMAL,wxNORMAL,0,"Times New Roman"}), 
-- more here Bold, Italics, Underlined etc 
-- Times New Roman 10 point 
	euTNRNorm10 = create( wxFont, {10,wxROMAN,wxNORMAL,wxNORMAL,0,"Times New Roman"}), 
-- more here Bold, Italics, Underlined etc 
-- Times New Roman 12 point 
	euTNRNorm12 = create( wxFont, {12,wxROMAN,wxNORMAL,wxNORMAL,0,"Times New Roman"}), 
	euTNRItal12 = create( wxFont, {12,wxROMAN,wxITALIC,wxNORMAL,0,"Times New Roman"}), 
-- more here Bold, Underlined etc 
-- Arial 10 point 
	euARNorm10 = create( wxFont, {10,wxDEFAULT,wxNORMAL,wxNORMAL,0,"Arial"}), 
	euARBold10 = create( wxFont, {10,wxDEFAULT,wxNORMAL,wxBOLD,0,"Arial"}), 
$ 
 
constant MenuWin =  
    create( wxFrame,{0,-1, "Menus"} ), 
    win = create( wxPanel, {MenuWin}) 
     
constant 
MenuBar = create( wxMenuBar, {MenuWin}), 
FileMenu = create( wxMenu, {MenuBar,"&File"}), 
    MenuNew     = create( wxMenuItem,{ FileMenu, wxID_NEW,"&New\tCtrl+N"}), 
    MenuOpen    = create( wxMenuItem,{ FileMenu, wxID_OPEN, "&Open"}), 
    MenuSave    = create( wxMenuItem,{ FileMenu, wxID_SAVE, "&Save"}), 
    MenuSaveAs  = create( wxMenuItem,{ FileMenu, wxID_SAVEAS, "Save &As"}) 
	append_separator( FileMenu ) 
-- etc etc 
-- etc etc 

I added :

set_default_font ( win, euARBold10) 
set_default_font (MenuWin, euTNRItal12) 

I put one or both of these lines separately or together in various places to see if the font will change on execution, but the font remains the same. I also tried and failed with using MenuBar instead of win or MenuWin

--   set_default_font (MenuBar, euTNRItal12) 

I also was not able to use later

set_menu_label ( MenuBar, FileMenu, "MyFileMenu") 

I am new to Euphoria and wxEuphoria. I shall appreciate help or direction to a working wxEuphoria program where the Font in the Menu can be changes dynamically, and the text of the labels can also be changed dynamically or redrawn or something like that.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu