GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simple Dialogs in Qu

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Example Code
Author Message
irvm
Familiar Face


Joined: 21 Sep 2005
Posts: 12

PostPosted: Wed Mar 15, 2006 3:35 pm    Post subject: Simple Dialogs in Qu Reply with quote

Since you invited us to post code, I'll add this version of your dialogs demo, just for comparison:
Code: (Plaintext)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

use Gtk (*) # requires Qu 1.21.03 +

app = application('Dialog Examples')
win = window()
win.border=10

panel = hbox(true,10)
win.add(panel)

left = vbox(true,10)
right = vbox(true,10)
panel.add([left,right])

left.add([button('Info Message', @on_click, 1),
          button('Error Message', @on_click 3),
          www.michahcarrick.com'])
     
right.add([button('Warning Message', @on_click,2),
           button('Question', @on_click,4),
           button('gtk-quit', @bail)])     
     
win.show_all
app.main

##

sub on_click(ctl:Int, param:Int)->Int
switch param
 case 1 Info("Did you know that it snowed today in Portland?")
     break
 case 2 Warn("I'm warning you for the last time!")
     break
 case 3 Error("BOOM! You messed up bad this time buddy!")
     break
 case 4 answer = Question("Do you like GTK+ programming?")
        if answer == DLG_YES Info('Good!','Darn right you do!') 
        elif answer == DLG_NO Info('Uh Oh!',"That's a horrible answer!")
        else Warn("Hey","Dont' you ignore my question!");;
;;   
return 0;;
Back to top
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 404
Location: Portland, OR USA

PostPosted: Wed Mar 15, 2006 4:02 pm    Post subject: Reply with quote

Cool.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Example Code All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP