From jytgyl at gmail.com Wed May 6 07:44:14 2009 From: jytgyl at gmail.com (jyoti goyal) Date: Wed, 6 May 2009 17:14:14 +0530 Subject: [Agar] set color of individual item Message-ID: <5afb52460905060444s572728aeh5585f449b12c07cc@mail.gmail.com> Hi I need to set the color of only a single button to some different value in my application. I tried using ag_style but that is changing the color of all the buttons ...How do I do it? pls send some suggestions.thanx in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail231.csoft.net/pipermail/agar/attachments/20090506/cec2fdd5/attachment.html From jytgyl at gmail.com Sat May 9 00:22:18 2009 From: jytgyl at gmail.com (jyoti) Date: Sat, 9 May 2009 04:22:18 +0000 (UTC) Subject: [Agar] select text in textarea Message-ID: Hi I need to select text in a textarea and an editbox using agar interfaces.How do I do it? From jytgyl at gmail.com Sat May 9 00:29:43 2009 From: jytgyl at gmail.com (jyoti) Date: Sat, 9 May 2009 04:29:43 +0000 (UTC) Subject: [Agar] delete entry from listbox Message-ID: Hi I have made a listbox using AG_Table. I need to delete some entries from the list . I have not found any way to do so. Pls help. From jytgyl at gmail.com Sat May 9 00:42:00 2009 From: jytgyl at gmail.com (jyoti) Date: Sat, 9 May 2009 04:42:00 +0000 (UTC) Subject: [Agar] delete entries from listbox Message-ID: Hi I have made a listbox using AG_Table. I need to delete some entries from the list . how to do it? From jytgyl at gmail.com Sat May 9 00:44:11 2009 From: jytgyl at gmail.com (jyoti) Date: Sat, 9 May 2009 04:44:11 +0000 (UTC) Subject: [Agar] get state of checkbutton Message-ID: Hi I need to get the state of checkbutton and radiobutton i.e. whether it is selected or not . I have not found any such method in agar. pls help. From andreas.krinke at gmx.de Sat May 9 15:48:11 2009 From: andreas.krinke at gmx.de (Andreas Krinke) Date: Sat, 09 May 2009 21:48:11 +0200 Subject: [Agar] get state of checkbutton In-Reply-To: References: Message-ID: <4A05DDFB.3090704@gmx.de> jyoti wrote: > I need to get the state of checkbutton and radiobutton i.e. whether it is > selected or not . I have not found any such method in agar. pls help. Look at checkbox.c in the agar/gui folder. The Draw function contains the information you need: static void Draw(void *obj) { AG_Checkbox *cb = obj; AG_WidgetBinding *stateb; void *p; int state; stateb = AG_WidgetGetBinding(cb, "state", &p); switch (stateb->vtype) { case AG_WIDGET_BOOL: case AG_WIDGET_INT: case AG_WIDGET_UINT: state = *(int *)p; ..... You need AG_WidgetGetBinding(). -- Andreas From jytgyl at gmail.com Mon May 11 02:01:28 2009 From: jytgyl at gmail.com (jyoti) Date: Mon, 11 May 2009 06:01:28 +0000 (UTC) Subject: [Agar] =?utf-8?q?ag=5Fsurface_query?= Message-ID: Hi I need to load an image surface on a checkbutton when it is clicked.I used AG_WidgetMapSurface in the function handling the click event but that is not working . But the same api is working if I use it in the draw operation of the widget. How to do it ? From jytgyl at gmail.com Mon May 11 04:21:53 2009 From: jytgyl at gmail.com (jyoti) Date: Mon, 11 May 2009 08:21:53 +0000 (UTC) Subject: [Agar] =?utf-8?q?ag=5Fsurface_query?= Message-ID: hi I need to load a surface on a checkbutton when it is clicked. I used AG_WidgetBlit in the click event of the widget but that is not working. But the surface is getting loaded in the draw operation of the checkbox. How to do it when an event occurs on checkbutton . Pls send ur suggestions as soon as possible. From vedge at hypertriton.com Mon May 11 05:11:31 2009 From: vedge at hypertriton.com (Julien Nadeau) Date: Mon, 11 May 2009 05:11:31 -0400 Subject: [Agar] ag_surface query In-Reply-To: References: Message-ID: <20090511091130.GA4639@csoft.net> On Mon, May 11, 2009 at 08:21:53AM +0000, jyoti wrote: > > hi > > I need to load a surface on a checkbutton when it is clicked. > I used AG_WidgetBlit in the click event of the widget but that is not working. > But the surface is getting loaded in the draw operation of the checkbox. > How to do it when an event occurs on checkbutton . Pls send ur suggestions as > soon as possible. As documented in the manual page, you cannot use the AG_WidgetBlit*() functions outside of rendering context. What would be the purpose of blitting a surface on a checkbox? From vedge at hypertriton.com Mon May 11 05:22:51 2009 From: vedge at hypertriton.com (Julien Nadeau) Date: Mon, 11 May 2009 05:22:51 -0400 Subject: [Agar] get state of checkbutton In-Reply-To: <4A05DDFB.3090704@gmx.de> References: <4A05DDFB.3090704@gmx.de> Message-ID: <20090511092251.GB4639@csoft.net> On Sat, May 09, 2009 at 09:48:11PM +0200, Andreas Krinke wrote: > jyoti wrote: > > I need to get the state of checkbutton and radiobutton i.e. whether it is > > selected or not . I have not found any such method in agar. pls help. > > Look at checkbox.c in the agar/gui folder. > > You need AG_WidgetGetBinding(). Outside of the internal widget implementation, I would not expect user code to retrieve widget states using AG_WidgetGetBinding(). The typical usage for these widgets would be to either bind to some integer, for instance using AG_RadioNewInt(), or if it is necessary to use an event handler, to retrieve the argument to "radio-changed". From vedge at hypertriton.com Mon May 11 05:30:27 2009 From: vedge at hypertriton.com (Julien Nadeau) Date: Mon, 11 May 2009 05:30:27 -0400 Subject: [Agar] delete entries from listbox In-Reply-To: References: Message-ID: <20090511093027.GC4639@csoft.net> On Sat, May 09, 2009 at 04:42:00AM +0000, jyoti wrote: > > Hi > > I have made a listbox using AG_Table. I need to delete some entries from the > list . how to do it? AG_Table is designed much like AG_Tlist, to display existing data, not to contain data. You will probably find it easier to use AG_TableNewPolled() with a routine to populate the table, or alternatively use AG_Treetbl. From vedge at hypertriton.com Mon May 11 05:39:36 2009 From: vedge at hypertriton.com (Julien Nadeau) Date: Mon, 11 May 2009 05:39:36 -0400 Subject: [Agar] select text in textarea In-Reply-To: References: Message-ID: <20090511093936.GD4639@csoft.net> On Sat, May 09, 2009 at 04:22:18AM +0000, jyoti wrote: > > Hi > > I need to select text in a textarea and an editbox using agar interfaces.How > do I do it? That has not been implemented yet. I've opened a bug report for the issue: http://libagar.org/bug/108. From vedge at hypertriton.com Mon May 11 06:27:38 2009 From: vedge at hypertriton.com (Julien Nadeau) Date: Mon, 11 May 2009 06:27:38 -0400 Subject: [Agar] set color of individual item In-Reply-To: <5afb52460905060444s572728aeh5585f449b12c07cc@mail.gmail.com> References: <5afb52460905060444s572728aeh5585f449b12c07cc@mail.gmail.com> Message-ID: <20090511102738.GF4639@csoft.net> On Wed, May 06, 2009 at 05:14:14PM +0530, jyoti goyal wrote: > Hi > > I need to set the color of only a single button to some different value in > my application. > I tried using ag_style but that is changing the color of all the buttons > ....How do I do it? Color values used by the default theme are kept in a global array for efficiency reasons. You could always manually render the text using AG_Text(3) and pass the surface to AG_ButtonSurface(), like so: AG_PushTextState(); AG_TextBGColorRGB(r, g, b); AG_TextColorRGB(r, g, b); AG_ButtonSurfaceNODUP(button, AG_TextRender("My label")); AG_PopTextState(); From jytgyl at gmail.com Tue May 12 02:48:49 2009 From: jytgyl at gmail.com (jyoti) Date: Tue, 12 May 2009 06:48:49 +0000 (UTC) Subject: [Agar] =?utf-8?q?AG=5FTextBGColorRGB?= Message-ID: Hi I am using AG_TextBGColorRGB to set the background color of a button but it is not working. I wrote the following code AG_PushTextState(); AG_TextBGColorRGB(0, 0,255); AG_TextColorRGB(255,0, 0); AG_Surface *s1 = AG_TextRender("but1"); AG_ButtonSurface(button, s1); but not getting desired result.pls help. From jytgyl at gmail.com Tue May 12 03:08:15 2009 From: jytgyl at gmail.com (jyoti) Date: Tue, 12 May 2009 07:08:15 +0000 (UTC) Subject: [Agar] =?utf-8?q?AG=5FRadiobutton?= Message-ID: hi for radiobuttons , all of them appear in a straight line vertically . But I want to control the positions of individual radiobuttons in the group i.e. radiobutton should be placed at the loaction specified by my program. Is it possible or they can only appear in a vertical line ? From jytgyl at gmail.com Tue May 12 03:56:40 2009 From: jytgyl at gmail.com (jyoti) Date: Tue, 12 May 2009 07:56:40 +0000 (UTC) Subject: [Agar] text display in agar Message-ID: Hi I want to draw text on a window.All the interfaces need a destination surface. Can I get a surface out of a widget or is there any other way to do so? Have tried textbox but my application doesnt need a widget for this purpose. I only want to do simple drawing of text. pls send ur suggestions.thanx in advance. From jytgyl at gmail.com Tue May 12 04:04:04 2009 From: jytgyl at gmail.com (jyoti) Date: Tue, 12 May 2009 08:04:04 +0000 (UTC) Subject: [Agar] surface mapping Message-ID: Hi Without using the draw operation of a widget,can I map a surface (having some text or image) on a widget? From olexandr.syd at gmail.com Wed May 13 19:45:48 2009 From: olexandr.syd at gmail.com (Olexandr Sydorchuk) Date: Wed, 13 May 2009 23:45:48 +0000 Subject: [Agar] select text in textarea References: <20090511093936.GD4639@csoft.net> Message-ID: <86ws8k4leb.fsf@pluto.homeworld> Edit boxes have some emacs-like binds (C-k (kill-line)), and I think that not too hard to add bind like in emacs C-m (set-mark-command ) and some binding for copy/paste. Its easy because you don't need to change to Draw(). But, imho, its for typical user it will be not easy to understand. Julien Nadeau writes: > On Sat, May 09, 2009 at 04:22:18AM +0000, jyoti wrote: >> >> Hi >> >> I need to select text in a textarea and an editbox using agar interfaces.How >> do I do it? > > That has not been implemented yet. I've opened a bug report for the > issue: http://libagar.org/bug/108. -- Olexandr From iistarion at gmail.com Sun May 31 10:20:57 2009 From: iistarion at gmail.com (Froilan) Date: Sun, 31 May 2009 14:20:57 +0000 (UTC) Subject: [Agar] Running agar with SDL + OpenGL app Message-ID: I'm trying to use Agar with my own SDL application. I just don't know what to do, although I tried lots of things. I've done the typical initialization: AG_InitCore("myapp", 0)!=-1 AG_InitVideoSDL(window, AG_VIDEO_OPENGL)!=-1 But then I just dont know what I've to do... Can anyone help me? I just need a simple example like drawing some text, since I don't know what else do I need to draw the gui on my window. I have my own loop and the typical drawing function where I write my ogl calls. Thanks in advance! From samuraileumas at yahoo.com Sun May 31 13:42:04 2009 From: samuraileumas at yahoo.com (Samuel Crow) Date: Sun, 31 May 2009 10:42:04 -0700 (PDT) Subject: [Agar] Fw: Running agar with SDL + OpenGL app Message-ID: <335476.20349.qm@web62006.mail.re1.yahoo.com> ----- Forwarded Message ---- > From: Samuel Crow > To: Froilan > Sent: Sunday, May 31, 2009 12:41:26 PM > Subject: Re: [Agar] Running agar with SDL + OpenGL app > > Hello Froilan, > > Look at the example in agar-1.3.3/demos/glview/ as a reference. It is not > compiled by default when you build the package source so you'll probably have to > run its configure script. > > > --Sam > > ----- Original Message ---- > > From: Froilan > > To: agar at lists.csoft.org > > Sent: Sunday, May 31, 2009 9:20:57 AM > > Subject: [Agar] Running agar with SDL + OpenGL app > > > > I'm trying to use Agar with my own SDL application. I just don't know what to > > do, although I tried lots of things. I've done the typical initialization: > > > > AG_InitCore("myapp", 0)!=-1 > > AG_InitVideoSDL(window, AG_VIDEO_OPENGL)!=-1 > > > > But then I just dont know what I've to do... Can anyone help me? I just need a > > simple example like drawing some text, since I don't know what else do I need > to > > draw the gui on my window. > > I have my own loop and the typical drawing function where I write my ogl > calls. > > > > Thanks in advance! > > > > _______________________________________________ > > Agar mailing list > > Agar at hypertriton.com > > http://libagar.org/lists.html From crm4x at mtsu.edu Sun May 31 16:20:36 2009 From: crm4x at mtsu.edu (chris) Date: Sun, 31 May 2009 20:20:36 +0000 (UTC) Subject: [Agar] =?utf-8?q?Crashing_with_AG=5FTextboxSizeHint_usage?= Message-ID: I've written a very basic app that creates a text box. It worked fine until I enter the line: AG_TextboxSizeHint(usernameBox, "XXXXXXXX"); When that line runs, my program crashes. VC++ says it's an "unhandled exception" at that line. Why does the program work fine when I comment that line out? Thanks in advance for any help From samuraileumas at yahoo.com Sun May 31 20:11:52 2009 From: samuraileumas at yahoo.com (Samuel Crow) Date: Sun, 31 May 2009 17:11:52 -0700 (PDT) Subject: [Agar] Running agar with SDL + OpenGL app In-Reply-To: References: <269099.46959.qm@web62007.mail.re1.yahoo.com> Message-ID: <879496.85590.qm@web62002.mail.re1.yahoo.com> Hello Carlos, Actually it IS using SDL internally. You shouldn't have to do anything special to use SDL in version 1.3.3 . In version 1.4 things will be different though. Agar encapsulates the SDL functionality in its own functions. --Sam ----- Original Message ---- > From: Carlos Yaque > To: Samuel Crow > Sent: Sunday, May 31, 2009 5:49:45 PM > Subject: Re: [Agar] Running agar with SDL + OpenGL app > > I've been looking this example but it's not using SDL, so I'm not sure > what to do. In my code I initialize SDL, and then the agar library. > The problem is that I dont know if I have to initialize anything else, > and what to do to render the gui elements, whether I have to set the > gl matrixes properly, if the rendering functions have to be inside my > "render" function... > > In fact it's a little bit frustrating going through the documentation, > it has almost no info on what to do and which order :S > > 2009/5/31 Samuel Crow : > > > > Hello Froilan, > > > > Look at the example in agar-1.3.3/demos/glview/ as a reference. It is not > compiled by default when you build the package source so you'll probably have to > run its configure script. > > > > > > --Sam > > > > ----- Original Message ---- > >> From: Froilan > >> To: agar at lists.csoft.org > >> Sent: Sunday, May 31, 2009 9:20:57 AM > >> Subject: [Agar] Running agar with SDL + OpenGL app > >> > >> I'm trying to use Agar with my own SDL application. I just don't know what to > >> do, although I tried lots of things. I've done the typical initialization: > >> > >> AG_InitCore("myapp", 0)!=-1 > >> AG_InitVideoSDL(window, AG_VIDEO_OPENGL)!=-1 > >> > >> But then I just dont know what I've to do... Can anyone help me? I just need > a > >> simple example like drawing some text, since I don't know what else do I need > to > >> draw the gui on my window. > >> I have my own loop and the typical drawing function where I write my ogl > calls. > >> > >> Thanks in advance! > >> > >> _______________________________________________ > >> Agar mailing list > >> Agar at hypertriton.com > >> http://libagar.org/lists.html > > > > > > > > > > From vedge at hypertriton.com Sun May 31 21:24:15 2009 From: vedge at hypertriton.com (Julien Nadeau) Date: Sun, 31 May 2009 21:24:15 -0400 Subject: [Agar] Crashing with AG_TextboxSizeHint usage In-Reply-To: References: Message-ID: <20090601012415.GA24503@csoft.net> On Sun, May 31, 2009 at 08:20:36PM +0000, chris wrote: > I've written a very basic app that creates a text box. > > It worked fine until I enter the line: > > AG_TextboxSizeHint(usernameBox, "XXXXXXXX"); > > When that line runs, my program crashes. VC++ says it's an "unhandled exception" > at that line. > > Why does the program work fine when I comment that line out? > > Thanks in advance for any help Does the text in your application otherwise render correctly when the line is commented out? Are you using an Agar compiled without Freetype support by any chance? From vedge at hypertriton.com Sun May 31 21:47:55 2009 From: vedge at hypertriton.com (Julien Nadeau) Date: Sun, 31 May 2009 21:47:55 -0400 Subject: [Agar] Running agar with SDL + OpenGL app In-Reply-To: <879496.85590.qm@web62002.mail.re1.yahoo.com> References: <269099.46959.qm@web62007.mail.re1.yahoo.com> <879496.85590.qm@web62002.mail.re1.yahoo.com> Message-ID: <20090601014755.GB24503@csoft.net> On Sun, May 31, 2009 at 05:11:52PM -0700, Samuel Crow wrote: > ----- Original Message ---- > > From: Carlos Yaque > > To: Samuel Crow > > Sent: Sunday, May 31, 2009 5:49:45 PM > > Subject: Re: [Agar] Running agar with SDL + OpenGL app > > > > I've been looking this example but it's not using SDL, so I'm not sure > > what to do. In my code I initialize SDL, and then the agar library. > > The problem is that I dont know if I have to initialize anything else, > > and what to do to render the gui elements, whether I have to set the > > gl matrixes properly, if the rendering functions have to be inside my > > "render" function... > > > > In fact it's a little bit frustrating going through the documentation, > > it has almost no info on what to do and which order :S Typically, you would render your GL scene using the AG_GLView widget (http://libagar.org/man3/AG_GLView). Since you're mentioning GL matrices I assume you have a good reason not to use Agar's event loop or AG_GLView. Have a look at: http://wiki.libagar.org/wiki/Background_rendering You can ignore the "GK_*" functions in the sample code. The point is to call AG_WindowDraw() from your event loop to render the GUI elements. In the example, the background is drawn after AG_BeginRendering(), which clears the background and sets up Agar's own clipping planes, and that is probably not what you want. Actually, I would suggest you try the latest Agar SVN, which makes the process much easier with the AG_VIDEO_OVERLAY flag to AG_InitVideo() / AG_InitVideoSDL(). If AG_VIDEO_OVERLAY is in effect, AG_BeginRendering() and AG_EndRendering() will not clear the background, and your GL state will be fully preserved. From crm4x at Mtsu.edu Sun May 31 22:08:23 2009 From: crm4x at Mtsu.edu (chris) Date: Mon, 1 Jun 2009 02:08:23 +0000 (UTC) Subject: [Agar] =?utf-8?q?Crashing_with_AG=5FTextboxSizeHint_usage?= References: <20090601012415.GA24503@csoft.net> Message-ID: > Does the text in your application otherwise render correctly when the line > is commented out? Are you using an Agar compiled without Freetype support > by any chance? > The textbox renders normal when I comment that line out, it just doesn't have any space for input so I need to use the AG_TextboxSizeHint function to allow room for input. I am using the Freetype version of Agar as well.. hmm...