GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Apr 24, 2014 5:57 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Simple Dialogs in Qu
PostPosted: Wed Mar 15, 2006 3:35 pm 
Offline
Familiar Face

Joined: Wed Sep 21, 2005 1:43 pm
Posts: 12
Since you invited us to post code, I'll add this version of your dialogs demo, just for comparison:
Code:
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;;


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 4:02 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
Cool.

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group