National Digital LMS
Module 2: Core Competencies

Chapter 4: SQL Query Language: DDL, DML & Advanced Joins

Table creation, constraints (PK, FK, Unique, Check), INNER/LEFT/RIGHT/FULL joins, subqueries, and aggregate functions.

20 mins read Pages 58 - 76
Bilingual Learning (English & اردو) Class 12 / HSSC-II Level

Chapter 4: Development of Graphical User Interface (GUI) (Page 45 – 59)

چوتھا باب: گرافیکل یوزر انٹرفیس (GUI) بنانا

A Graphical User Interface provides visual interactive controls—windows, menus, icons, text boxes, and push buttons—allowing intuitive human interaction via pointer devices. This chapter explores event-driven programming architectures, the Python standard Tkinter library, core widget attributes, layout geometry managers (.pack, .grid, .place), event bindings, and building complete form-based desktop applications.

گرافیکل یوزر انٹرفیس (GUI) ایک ایسا بصری ماحول مہیا کرتا ہے جس میں صارف کالی اسکرین پر ٹیکسٹ کمانڈز ٹائپ کرنے کے بجائے ماؤس، بٹنوں، ان پٹ باکسز اور مینوز کے ذریعے کمپیوٹر سے رابطہ کرتا ہے۔ اس باب میں ایونٹ ڈریون پروگرامنگ، پائتھن کی آفیشل ٹکنٹر (Tkinter) لائبریری، ویجٹس اور لے آؤٹ بنانے کے طریقے شامل ہیں۔
Comprehensive Textbook Learning Material (تفصیلی تعلیمی مواد)
Full Syllabus Coverage • BISE Punjab
1 1. Event-Driven Programming Model vs. Sequential Execution
۱. ایونٹ ڈریون پروگرامنگ بمقابلہ روایتی تسلسل
English Theoretical Concept & Technical Breakdown:
Traditional scripts operate under a batch processing paradigm: line 1 executes, followed by line 2, progressing monotonically to completion. In **Event-Driven Programming**, the application starts, constructs the visual window hierarchy, and enters an infinite background listening loop called the **Main Event Loop** (`root.mainloop()`). The program remains idle until an external **Event** occurs (e.g. mouse click `<Button-1>`, key press `<Return>`, or window resize). When an event fires, the loop dispatches an execution call to the associated **Callback Function**.
آسان اردو میں مکمل اور تفصیلی وضاحت:
روایتی پروگرام اوپر سے نیچے ایک ترتیب میں چل کر ختم ہو جاتے تھے۔ جبکہ GUI میں ایونٹ ڈریون طریقہ استعمال ہوتا ہے جہاں ونڈو بننے کے بعد پروگرام ایک دائرے میں گھومتا رہتا ہے جسے **ایونٹ لوپ (`root.mainloop()`)** کہتے ہیں۔ جب صارف ماؤس سے کلک کرتا ہے یا کی بورڈ سے بٹن دباتا ہے، تو وہ کلک ایک **ایونٹ** کہلاتا ہے اور کمپیوٹر اس کے جواب میں متعلقہ فنکشن چلا دیتا ہے۔
Real-World Student Analogy (روزمرہ زندگی سے آسان فہم مثال):
In English: A telephone helpline operator: Sits quietly at their desk until an incoming phone call rings (an Event). They answer the caller, complete the assistance, and return to waiting for the next call.
کال سینٹر کا نمائندہ: وہ خاموشی سے بیٹھا رہتا ہے جب تک کال کی گھنٹی نہ بجے (ایونٹ نہ ہو)۔ گھنٹی بجتے ہی وہ بات سنتا ہے اور پھر اگلی کال کا انتظار کرنے لگتا ہے۔
BISE Punjab Board Examination Tip (اہم امتحانی نکات):
Short Question: "What is an event-driven program and what is the role of root.mainloop() in Tkinter?"
2 2. Core Tkinter Widgets & Layout Geometry Managers
۲. ٹکنٹر ویجٹس اور لے آؤٹ منیجرز کا موازنہ
English Theoretical Concept & Technical Breakdown:
Tkinter provides standard user interface controls called **Widgets**:
- `Tk()`: The root master window container.
- `Label`: Displays static or dynamic text strings and images.
- `Entry`: Single-line text input field (with optional password masking `show="*"`)
- `Button`: Interactive clickable button linked to actions via `command=callback_function`.
- `Checkbutton` & `Radiobutton`: Multi-selection checkboxes and mutually exclusive radio choices.

### Layout Geometry Managers Comparison:
| Geometry Manager | Mechanism | Best Use Case |
|---|---|---|
| `.pack()` | Stacks widgets automatically against edges (`top`, `bottom`, `left`, `right`). | Quick vertical stacking or simple toolbars. |
| `.grid(row=r, column=c)` | Positions widgets cleanly in rows and columns like a spreadsheet table. | Professional data-entry forms with aligned labels & inputs. |
| `.place(x=px, y=py)` | Places widgets at absolute pixel coordinates. | Fixed-size game canvases; rigid, not responsive to resize. |
آسان اردو میں مکمل اور تفصیلی وضاحت:
ٹکنٹر میں اسکرین پر نظر آنے والی ہر چیز کو **ویجٹ (Widget)** کہا جاتا ہے:
- `Tk()`: مین ونڈو جس کے اندر باقی تمام بٹن اور خانے بنتے ہیں۔
- `Label`: اسکرین پر تحریر دکھانے کا خانہ۔
- `Entry`: صارف سے نام، رول نمبر یا پاس ورڈ ٹائپ کروانے کا سنگل لائن خانہ۔
- `Button`: ماؤس سے دبایا جانے والا بٹن جو کسی فنکشن کو چلاتا ہے۔

### لے آؤٹ بنانے کے تین طریقے:
۱. `.pack()`: چیزوں کو اوپر تلے یا دائیں بائیں قطار میں جمع کرنا۔
۲. `.grid(row, column)`: اسکرین کو کالموں اور قطاروں میں بانٹ کر فارم کے خانوں کو بالکل آمنے سامنے سیدھ میں رکھنا (سب سے بہترین طریقہ)۔
۳. `.place(x, y)`: پکسلز کے عین حساب سے چیز رکھنا (یہ اسکرین بڑی کرنے پر پھیلتی نہیں ہے)۔
Real-World Student Analogy (روزمرہ زندگی سے آسان فہم مثال):
In English: `.grid()` is like organizing furniture in neat tiled rooms. `.place()` is pinning a post-it note at an exact measurement mark on a corkboard.
`.grid()` ایکسل کی شیٹ کی طرح خانوں میں خوبصورتی سے چیزیں جمانا ہے۔ `.place()` دیوار پر کیل ٹھونک کر فریم لٹکانا ہے۔
BISE Punjab Board Examination Tip (اہم امتحانی نکات):
Board Practical Question: Write a Python Tkinter program to create a login window with Username, Password Entry, and a Login Button.
Looking for the official textbook pages?

Jump directly to pages 58 - 76 in the embedded streaming viewer.

PCTB Official Textbook - Chapter 4 Start Page: 58
Download
Protected Stream Proxy: Direct hotlinking is blocked. Byte-ranges are streamed dynamically.
Class 12 Chapters