Number

Introduction

The following tutorial explains how to create and modify a number widget. It is very similar to the text widget except it only accepts integers and not a string as its input.

This is useful as you can play with the format easier and also it runs faster without allocating new memory as it would for a string if it was updated.

Creating a number object

To create a number widget you use the following command:

num = [gui.CTRL_NUMBER, x, y, font_size, option, c_fmt_str, num]

Input Parameters:

  • x [int] = x coordinate

  • y [int] = y coordinate

  • font [int] = font of the text

  • option [int] = option for widget, see Options for more details

  • c_fmt_str [string] = format string in the C language format.

  • num [int] = The value of the num to be displayed