Author Topic: Buttons for qb programs  (Read 3585 times)

0 Members and 1 Guest are viewing this topic.

Offline Parkland

  • Newbie
  • Posts: 51
    • View Profile
Buttons for qb programs
« on: April 17, 2020, 01:28:57 pm »
This is code I've been adding to things for years, it works alright.
It creates buttons with 1 instruction,
then 1 instruction to render the graphics, and 1 for the mouse procedure.
I've used it for 1 or 2 buttons, and even on screen keyboard it worked before.

To make button:
CALL guiaddbutton("button1", "Buttons!!!", 50, 50, 150, 70, 0)
The button name (whatever you want) , the button text (or filename if image is used),  x,y,x,y,  then 0 or 1, 0 is text button, 1 is image.

CALL guirender
CALL handlemouse

clickname$ will now = the name of the button that was clicked.

* winbutt11.bas (Filesize: 12.41 KB, Downloads: 213)

Offline Parkland

  • Newbie
  • Posts: 51
    • View Profile
Re: Buttons for qb programs
« Reply #1 on: April 17, 2020, 01:37:32 pm »
Just a note, you'll have to comment out the one "guiaddbutton" command that uses and image, or change it to an image that exists on your computer
Kind of forgot to comment that out.

Also, I commented out the load font command in the beginning of the program, and I think 3 font references throughout the program for compatibility and ease of use, but it could use custom fonts if you find those and put them back in as active
« Last Edit: April 17, 2020, 01:39:15 pm by Parkland »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Buttons for qb programs
« Reply #2 on: April 17, 2020, 02:23:11 pm »
I don't think WinButt would be a Microsoft approved name. Just sayin'.

You might want to check out Fell's InForm Sub-Forum for buttons, etc., too. Fun stuff!

Pete :D
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Parkland

  • Newbie
  • Posts: 51
    • View Profile
Re: Buttons for qb programs
« Reply #3 on: April 17, 2020, 05:23:54 pm »
Micro who?
haha jk.

I downloaded that inform once, couldn't figure it out within 5 minutes and never looked at it again as I had no need for anything so far that elaborate.
I may check it out again soon though.

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Buttons for qb programs
« Reply #4 on: April 17, 2020, 05:56:52 pm »
I don't think WinButt would be a Microsoft approved name. Just sayin'.

Haha! I LOLed at that one. Your wise ass cracks me up Pete.
In order to understand recursion, one must first understand recursion.