I know almost nothing about the internal of jgtkgrid and the following is untested. from the definition of grid, it shows the noun T_TV holds a pointer to the treeview, so that 'window' is accessed using gkt api.
require 'gui/jgtkgrid' h1=:grid i.4 4 window=. gtk_widget_get_toplevel_jgtk_ T_TV__h1 gtk_window_set_title_jgtk_ window ;'grid 1' Пнд, 06 Фев 2012, Lippu Esa писал(а): > Hi > > As a workaround I made these changes to my jgtkgrid.ijs to get an attribute > named "window" that can be accessed from outside: > > create=: 3 : 0 > '' create y > : > x initgrid y > window=:0 NB. define "window" attribute > ) > ... > grid=: 3 : 0 > '' grid y > : > if. -.IFGTK do. gtkinit'' end. > newgrid=. conew 'jgtkgrid' > x create__newgrid y > window=. gtk_window_new GTK_WINDOW_TOPLEVEL > window__newgrid=: window NB. set the attribute on > creation > gtk_window_set_title window;'jgtkgrid ',>newgrid > ... > > A simple demo: > > require 'gui/jgtkgrid' > h1=:grid i.4 4 > h2=:grid i.5 5 > gtk_window_set_title__h1 window__h1 ;'grid 1' > gtk_window_set_title__h2 window__h2 ;'grid 1' > > This works for me. Any comments for this approach? I am sure there is a > better and cleaner way. > > Esa > -----Original Message----- > From: programming-boun...@jsoftware.com > [mailto:programming-boun...@jsoftware.com] On Behalf Of Lippu Esa > Sent: 3. helmikuuta 2012 12:23 > To: Programming forum > Subject: [Jprogramming] How to set the window title in jgtkgrid? > > Hello! > > I have a simple question but couldn't find the answer anywhere (my fault for > sure): > > How to set the window title in jgtkgrid? > > I was able to find the place where it is set initially but can't figure out > how to access the window noun below in order to use the gtk_window_set_title: > > a=.grid i.4 > linear 'grid__a' > 3 : 0 > '' grid y > : > if. -.IFGTK do. gtkinit'' end. > newgrid=. conew 'jgtkgrid' > x create__newgrid y > window=. gtk_window_new GTK_WINDOW_TOPLEVEL > gtk_window_set_title window;'jgtkgrid ',>newgrid > ... > ) > > Any help will be greatly appreciated. > > Esa > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm