|
Revision 8, 507 bytes
(checked in by Chris Miller, 5 years ago)
|
First steps of DFL GTK.
|
| Line | |
|---|
| 1 |
// Copyright (C) 2007 Christopher E. Miller |
|---|
| 2 |
// See the included license.txt for license details. |
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
/// |
|---|
| 6 |
module dfl.application; |
|---|
| 7 |
|
|---|
| 8 |
import dfl.form, dfl.base; |
|---|
| 9 |
import dfl.internal.gtk; |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
/// |
|---|
| 13 |
class Application |
|---|
| 14 |
{ |
|---|
| 15 |
static: |
|---|
| 16 |
|
|---|
| 17 |
/// |
|---|
| 18 |
void run(Form mainForm) |
|---|
| 19 |
{ |
|---|
| 20 |
if(mainForm) |
|---|
| 21 |
mainForm.show(); |
|---|
| 22 |
|
|---|
| 23 |
gtk_main(); |
|---|
| 24 |
} |
|---|
| 25 |
|
|---|
| 26 |
/// ditto |
|---|
| 27 |
void run() |
|---|
| 28 |
{ |
|---|
| 29 |
return run(null); |
|---|
| 30 |
} |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
/// |
|---|
| 34 |
void exitThread() |
|---|
| 35 |
{ |
|---|
| 36 |
gtk_main_quit(); |
|---|
| 37 |
} |
|---|
| 38 |
} |
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
static this() |
|---|
| 42 |
{ |
|---|
| 43 |
gtk_init(null, null); // ... |
|---|
| 44 |
} |
|---|