From: Olivier Andrieu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16352.20548.48550.69416 at akasha.ijm.jussieu.fr> Date: Wed, 17 Dec 2003 13:47:00 +0100 To: stalkern2 at tin.it Cc: lablgtk at kaba.or.jp Subject: Re: About automatic column sorting and right-click detection In-Reply-To: <200312171132.49128.stalkern2 at tin.it> References: <200312171132.49128.stalkern2 at tin.it> Stalkern 2 [Wednesday 17 December 2003] : > > Hello to everybody > > I'm porting lablgtk to lablgtk2 and it's definitely a pleasant > activity. I find that the "Model/View/Controller design" makes > everything cleaner. > > Now I have two silly questions, both related to signal handling > somehow. I've been studying the examples in C that I could find on > the Internet, but lablgtk-ication is not so easy for me, so I'm > asking here. > > 1) I have seen how to set sorting for viewcolumns in a listview. > Now, what function would I use to emulate clicking on a view > column header? (I mean, what stands for viewcolumn#clicked ? ) There's a gtk_tree_view_column_clicked () that emits the clicked signal but it's not wrapped (as you said, there's no #clicked method). "Manually" emitting the signal should work : GtkSignal.emit_unit viewcolum#as_column GtkTree.TreeViewColumn.S.clicked > 2) How do I recognize a right-clicking on a button or a drawing > area? I'm getting a bit puzzled by events and signals (and types > with type variables like GtkSignal.t) All event-related methods and signals are in an #event sub-object. So, with button#event#connect#button_press callback you should be able to detect righ-clicks. Note that sometimes you have to modify the event mask so that the events you're interested in are reported : button#event#add . -- Olivier