Path: news.cs.au.dk!news.net.uni-c.dk!uninett.no!news-feed.inet.tele.dk!bofh.vszbr.cz!newsfeed101.telia.com!news101.telia.com!not-for-mail From: Bo Normann Newsgroups: comp.lang.beta Subject: Making new pushbuttons at runtime Date: Tue, 27 Jul 1999 12:07:28 +0200 Organization: Customer at Telia Danmark (http://www.telia.dk) Lines: 50 Message-ID: <379D84DF.8D5D41A8@stofanet.dk> NNTP-Posting-Host: pc96050.stofanet.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news101.telia.com 933070139 16994 212.10.29.50 (27 Jul 1999 10:08:59 GMT) X-Complaints-To: abuse@telia.dk NNTP-Posting-Date: 27 Jul 1999 10:08:59 GMT X-Mailer: Mozilla 4.5 [en] (Win98; I) X-Accept-Language: en Xref: news.cs.au.dk comp.lang.beta:12041 Hello, I've run into another problem and I hope that someone is able to help me : The problem is that I need to make some pushbuttons at runtime and the number of buttons may vary, and I can't seem to make it work without declaring a constant number of pushbuttons, but that is not an okay solution in this case, so if anyone know how to dynamically invoke new pushbuttons I'd be grateful. I've tried something like this : inx_list is an integer Buttons is arraycontainer of generel pushbuttons Button is a generel button : Generel_button: pushbutton (# Label_button : ^Text; x_pos,y_pos: @integer; open::< (# do Label_button[]->label; borderStyles.shadowOut->border.style; (60,20)->size; (x_pos,y_pos)->position; #); eventhandler ::< (# OnMouseUp ::< (# do INNER #) #); enter(Label_button[],x_pos,y_pos) #); And what I've tried is the following : (inx_list)-> Buttons.get->Button[]; (Text[],(inx_r-1)*65+15,(inx_s-1)*25+35)-> Button; (Button[],inx_liste)-> Buttons.put; But I only get one pushbutton it seems and position is (0,0) Any help is appriciated Please mail me at normann@stofanet.dk Kind regards Bo