' BaCon
' Add images as buttons and tool-tips 3x5 format
using 32x32 pixel icons
' bacon-icon-mate.bac
' Note you may not have mate installed so use other
icons
' TESTED on mint 18.2
INCLUDE "hug.bac"
INIT
SUB application_exit_clicked
PRINT
"application_exit"
END SUB
SUB color_picker_clicked
PRINT
"color_picker"
END SUB
SUB go_previous_clicked
PRINT
"go_previous"
END SUB
SUB bookmark_new_list_clicked
PRINT
"bookmark_new_list"
END SUB
SUB go_down_clicked
PRINT
"go_down"
END SUB
'second row
SUB edit_cut_clicked
PRINT
"edit_cut"
END SUB
SUB dialog_ok_apply_clicked
PRINT
"dialog_ok_apply"
END SUB
SUB list_add_clicked
PRINT
"list_add"
END SUB
SUB view_refresh_clicked
PRINT
"view_refresh"
END SUB
SUB configure_clicked
PRINT
"configure"
END SUB
'third row
SUB draw_eraser_clicked
PRINT
"draw_eraser"
END SUB
SUB run_build_clicked
PRINT
"run_build"
END SUB
SUB edit_redo_clicked
PRINT
"edit_redo"
END SUB
SUB tools_wizard_clicked
PRINT
"tools_wizard"
END SUB
SUB view_preview_clicked
PRINT
"view_preview_clicked"
END SUB
Mainwin = WINDOW( "BaCon image-mate", 240, 170 )
application_exit =
IMAGE("/usr/share/icons/mate/32x32/actions/application-exit.png"
,30,30)
ATTACH(Mainwin, application_exit, 15, 30)
CALLBACK( application_exit ,
application_exit_clicked)
PROPERTY( application_exit, "tooltip-text",
"application-exit")
color_picker =
IMAGE("/usr/share/icons/mate/32x32/actions/color-picker.png"
,30,30)
ATTACH(Mainwin, color_picker, 50, 30)
CALLBACK(color_picker ,color_picker_clicked)
PROPERTY(color_picker, "tooltip-text",
"color_picker")
go_previous =
IMAGE("/usr/share/icons/mate/32x32/actions/go-previous.png"
,30,30)
ATTACH(Mainwin, go_previous, 90, 30)
CALLBACK(go_previous ,go_previous_clicked)
PROPERTY(go_previous, "tooltip-text",
"go_previous")
bookmark_new_list =
IMAGE("/usr/share/icons/mate/32x32/actions/bookmark-new-list.png"
,30,30)
ATTACH(Mainwin, bookmark_new_list, 130, 30)
CALLBACK(bookmark_new_list
,bookmark_new_list_clicked)
PROPERTY(bookmark_new_list, "tooltip-text",
"bookmark_new_list")
go_down =
IMAGE("/usr/share/icons/mate/32x32/actions/go-down.png"
,30,30)
ATTACH(Mainwin, go_down, 170, 30)
CALLBACK(go_down ,go_down_clicked)
PROPERTY(go_down, "tooltip-text", "go_down")
' second row
edit_cut =
IMAGE("/usr/share/icons/mate/32x32/actions/edit-cut.png"
,30,30)
ATTACH(Mainwin, edit_cut, 15, 70)
CALLBACK( edit_cut , edit_cut_clicked)
PROPERTY( edit_cut , "tooltip-text", " edit_cut")
dialog_ok_apply =
IMAGE("/usr/share/icons/mate/32x32/actions/dialog-ok-apply.png"
,30,30)
ATTACH(Mainwin, dialog_ok_apply, 55, 70)
CALLBACK(dialog_ok_apply ,dialog_ok_apply_clicked)
PROPERTY(dialog_ok_apply, "tooltip-text",
"dialog_ok_apply")
list_add =
IMAGE("/usr/share/icons/mate/32x32/actions/list-add.png"
,30,30)
ATTACH(Mainwin, list_add, 90, 70)
CALLBACK(list_add ,list_add_clicked)
PROPERTY(list_add, "tooltip-text", "list_add")
view_refresh =
IMAGE("/usr/share/icons/mate/32x32/actions/view-refresh.png"
,30,30)
ATTACH(Mainwin, view_refresh, 130, 70)
CALLBACK(view_refresh ,view_refresh_clicked)
PROPERTY(view_refresh, "tooltip-text",
"view_refresh")
configure =
IMAGE("/usr/share/icons/mate/32x32/actions/configure.png"
,30,30)
ATTACH(Mainwin, configure, 170, 70)
CALLBACK(configure ,configure_clicked)
PROPERTY(configure, "tooltip-text", "configure")
'third row
draw_eraser =
IMAGE("/usr/share/icons/mate/32x32/actions/draw-eraser.png"
,30,30)
ATTACH(Mainwin, draw_eraser, 15, 110)
CALLBACK( draw_eraser , draw_eraser_clicked)
PROPERTY( draw_eraser , "tooltip-text", "
draw_eraser")
run_build =
IMAGE("/usr/share/icons/mate/32x32/actions/run-build.png"
,30,30)
ATTACH(Mainwin, run_build, 55, 110)
CALLBACK(run_build ,run_build_clicked)
PROPERTY(run_build, "tooltip-text", "run_build")
edit_redo =
IMAGE("/usr/share/icons/mate/32x32/actions/edit-redo.png"
,30,30)
ATTACH(Mainwin, edit_redo, 90, 110)
CALLBACK(edit_redo ,edit_redo_clicked)
PROPERTY(edit_redo, "tooltip-text", "edit_redo")
tools_wizard =
IMAGE("/usr/share/icons/mate/32x32/actions/tools-wizard.png"
,30,30)
ATTACH(Mainwin, tools_wizard, 130, 110)
CALLBACK(tools_wizard ,tools_wizard_clicked)
PROPERTY(tools_wizard, "tooltip-text",
"tools_wizard")
view_preview =
IMAGE("/usr/share/icons/mate/32x32/actions/view-preview.png"
,30,30)
ATTACH(Mainwin, view_preview, 170, 110)
CALLBACK(view_preview ,view_preview_clicked)
PROPERTY(view_preview, "tooltip-text",
"view_preview")
' Create a label "click on an image" with text,
100 x 30
My_label = MARK( "click on an image", 130, 165 )
' Attach the label to the main window
ATTACH( Mainwin, My_label, 0, 75 )
'--- BUTTONS ---
Close_btn = STOCK("gtk-close", 100, 28)
ATTACH(Mainwin, Close_btn, 290, 365)
'--- CALLBACKS ---
CALLBACK(Close_btn, QUIT)
DISPLAY
|