Advertisement
anatolt

btn_maker

Jan 28th, 2015
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. If OpenWindow(0,100,100,100,100,"Кнопки")
  2.   ButtonGadget(0,10,10,80,30,"батон")
  3.   button_y = 10
  4.   window_height = 100
  5.   Repeat
  6.     ev = WaitWindowEvent()
  7.     If ev = #PB_Event_Gadget And EventGadget() = 0
  8.       button_y + 30
  9.       window_height + 30
  10.       ResizeWindow(0,100,100,100,window_height)
  11.       i + 1
  12.       txt$ = "батон " + i
  13.       ButtonGadget(#PB_Any,10,button_y,80,30,txt$)
  14.     EndIf
  15.     ;закрывашка по ескейпу. весь код написан руками, кроме закрывашки
  16.     If CreatePopupMenu(0) : MenuItem(1, "Quit") : EndIf
  17.     If ev = #PB_Event_Menu And EventMenu() = 1 : End : EndIf
  18.     AddKeyboardShortcut(0, #PB_Shortcut_Escape, 1)
  19.   Until ev = #PB_Event_CloseWindow
  20. EndIf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement