# File tst/tst_locana.rb, line 792 def tst_bitmaps() bmp1 = Lpixmap.new('bmp1', " #define b2_width 16 #define b2_height 16 static unsigned char b2_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; ") bmp2 = Lpixmap.new('bmp2').load_from_file('images/bwidget.xbm') bmp3 = Lbitmap.load_from_file('bwidget', 'images/bwidget.xbm') #bmp4 = Lbitmap.load_from_file('balloon', 'images/balloon.xpm') #puts bmp4 #bmp4 = bmp2 #bmp5 = 'balloon.xpm' Lwindow.new(:TestBitmap, :text=>'Popup Bitmap Window') { label(:label1, :pos=>[2, 0], :text=>'This tests the :bitmap attribute of the button object') button(:b_image11, :sticky=>:nw, :below=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp1) button(:b_image12, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp1, :width=>32, :height=>32) button(:b_image13, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp1, :width=>12, :height=>12) button(:b_image21, :sticky=>:nw, :below=>:b_image11, :padx=>10, :pady=>10, :bitmap=>bmp2) button(:b_image22, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp2, :width=>32, :height=>32) button(:b_image23, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp2, :width=>11, :height=>11) button(:b_image31, :sticky=>:nw, :below=>:b_image21, :padx=>10, :pady=>10, :bitmap=>bmp3) button(:b_image32, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp3, :width=>32, :height=>32) button(:b_image33, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp3, :width=>11, :height=>11) #button(:b_image41, :sticky=>:nw, :below=>:b_image31, :padx=>10, :pady=>10, :bitmap=>bmp4) #button(:b_image42, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp4, :width=>32, :height=>32) #button(:b_image43, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp4, :width=>11, :height=>11) #button(:b_image51, :sticky=>:nw, :below=>:b_image41, :padx=>10, :pady=>10, :bitmap=>bmp5) #button(:b_image52, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp5, :width=>32, :height=>32) #button(:b_image53, :sticky=>:nw, :after=>:prev, :padx=>10, :pady=>10, :bitmap=>bmp5, :width=>11, :height=>11) button(:b_ok, :sticky=>:se, :padx=>10, :pady=>10, :text=>'Ok', :tab_order=>-1) # turn off the tab key so key_press events can occur in the window, otherwise the button gets the keyboard focus b_ok.on_click = %{close()} # this button will close the form } end