Re: [lazarus] Show hint from code
On Fri, 19 May 2006 02:25:16 +0200 "A.J. Venter" <[EMAIL PROTECTED]> wrote: > >[...] > > > Did you make any changes ? I'll test mine tomorrow (it's very late > > > here) > > > > No, I did a svn update, then I went to the command line, and did "make > > clean all" > Doesn't work here. What doesn't work? > > Next I recompiled only LCL for Gtk2 (from the IDE), and it worked. > My lazarus hangs when I do that, Can you reproduce that? If yes, please start the IDE in gdb and create a backtrace. > I have to rerun make, then rebuild with > gtk1, gives me enough gtk2 for my apps to be compiled - but it might > prevent the GTK2 def from being passed to trayicon ? If so that's a bug > either in lazarus or in ttrayicon, I'm not sure. > On a hunch I opened the ttrayicon.lpk file, changed it's compiler options > to use gtk2, reinstalled, rebuilt wole for gtk2 - same result. Same stack > trace as well. So it doesn't matter what the component's compiler options > say - which makes sense, it ought to receive it from the parent app. But > it also ought to do so regardless of whether the LCL is using the same > widget set as the project target. When the IDE compiles itself (LCL + IDE + installed packages) it compiles for the target set in the configure build lazarus dialog (Target cpu, os, widgetset). Even if the project has another target. This has been fixed a few weeks ago, so it does not always work with 0.9.14. > I reckon I should fix the lazarus issue first but I am stumped as to what > could be causing it. Even a gdb backtrace didn't tell me anything usefull, > > just that it's pango that crashed. > Lazarus's own backtraces are talking bull, complaining about crashes in > whichever component was the last to be added, remove the component and it > just moves one step back in history - e.g. it doesn't show me what is > REALLY wrong. > Mattias you wouldn't have any theories perhaps ? If I have any idea where > to look for the cause of the bug I would be happy to fix it. Where are the crashes? In the IDE? Which widgetset? Which components installed? Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
> > Where can I get this component? Does it provide multi-monitor support on > X11? It's in my olpack svn co svn://silentcoder.co.za/lazarus/olpack I think olpack depends on gamepack (same dir) as well (if I remember right). > > I use some very special methods on the magnifier to have multi-monitor > support on Windows, but on Unix I just call Screen.Width and > Screen.Height, and I don't know how good their multimonitor support > is. Actually, that's pretty much all I use as well but I can tell you that it is quite sufficient actually. On X it works perfectly because of the way xinerama works. Xinerama effectively just expands your desktop across the monitors - if the res's are different this tends to cause a bit of havoc actually as you can litterally drag a window half-way between to screens and end up with one half the window twice the PHYSICAL size of the other. Twinview from nvidia cards provides some nicer options though - mine is cloned since my secondary monitor is my TV anyway and I only use the feature to watch movies on the big screen. > > > Anyway, enough philosophies, let me know if I can help you with the > > coding on this. > > Do you want to write this unit? If you have any problems, I can help. > If not, I will put on my to do list, but I cannot guarantee it will be > ready soon (too many things to do). I just wanted to make sure we both > agree on what is being implemented, and now I am. Well I'll make a start on it at least, and buzz you if I get stuck. I cannot imagine it can be TOO hard. > > > Did you make any changes ? I'll test mine tomorrow (it's very late here) > > No, I did a svn update, then I went to the command line, and did "make > clean all" Doesn't work here. > > Next I recompiled only LCL for Gtk2 (from the IDE), and it worked. My lazarus hangs when I do that, I have to rerun make, then rebuild with gtk1, gives me enough gtk2 for my apps to be compiled - but it might prevent the GTK2 def from being passed to trayicon ? If so that's a bug either in lazarus or in ttrayicon, I'm not sure. On a hunch I opened the ttrayicon.lpk file, changed it's compiler options to use gtk2, reinstalled, rebuilt wole for gtk2 - same result. Same stack trace as well. So it doesn't matter what the component's compiler options say - which makes sense, it ought to receive it from the parent app. But it also ought to do so regardless of whether the LCL is using the same widget set as the project target. I reckon I should fix the lazarus issue first but I am stumped as to what could be causing it. Even a gdb backtrace didn't tell me anything usefull, just that it's pango that crashed. Lazarus's own backtraces are talking bull, complaining about crashes in whichever component was the last to be added, remove the component and it just moves one step back in history - e.g. it doesn't show me what is REALLY wrong. Mattias you wouldn't have any theories perhaps ? If I have any idea where to look for the cause of the bug I would be happy to fix it. -- "there's nothing as inspirational for a hacker as a cat obscuring a bug by sitting in front of the monitor" - Boudewijn Rempt A.J. Venter Chief Software Architect OpenLab International www.getopenlab.com www.silentcoder.co.za +27 82 726 5103 _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
Kina like my ScreenSize component uses two completely different approaches. Under X platforms it uses Xlib calls to get the screen dimensions, under Where can I get this component? Does it provide multi-monitor support on X11? I use some very special methods on the magnifier to have multi-monitor support on Windows, but on Unix I just call Screen.Width and Screen.Height, and I don't know how good their multimonitor support is. Anyway, enough philosophies, let me know if I can help you with the coding on this. Do you want to write this unit? If you have any problems, I can help. If not, I will put on my to do list, but I cannot guarantee it will be ready soon (too many things to do). I just wanted to make sure we both agree on what is being implemented, and now I am. Did you make any changes ? I'll test mine tomorrow (it's very late here) No, I did a svn update, then I went to the command line, and did "make clean all" Next I recompiled only LCL for Gtk2 (from the IDE), and it worked. thanks, -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
On 5/18/06, Felipe Monteiro de Carvalho <[EMAIL PROTECTED]> wrote: Also a system to have the display area contain either a caption or a custom control needs to be created. A simple way to do this is by having a TCaption on the display area, and the user can pass an empty text to it, and put it's own control on top of it. -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
> > Thanks > > It would be nicer to have wole done in GTK2, but that is not urgent, I > > don't need gtk2 for developing it. > > Just tested latest subversion lazarus + trayicon. It's working normally. Not working here: Stack trace include: TApplication.HandleException Access violation Stack trace: $0820BE55 $08205B49 TWIDGETTRAYICON__CREATEFORM, line 179 of wsgtktrayicon.pas $08205C59 TWIDGETTRAYICON__SHOW, line 254 of wsgtktrayicon.pas $08202C76 TTRAYICON__SHOW, line 159 of trayicon.pas $0807CF6B TWOLEMAINFORM__FORMACTIVATE, line 252 of wolemain.pas $0807314A TCUSTOMFORM__ACTIVATE, line 482 of ./include/customform.inc $080730C5 TCUSTOMFORM__WMACTIVATE, line 455 of ./include/customform.inc $08061DE7 $080F4A8E TCONTROL__WNDPROC, line 1534 of ./include/control.inc $080EC469 TWINCONTROL__WNDPROC, line 3378 of ./include/wincontrol.inc $08073CE9 TCUSTOMFORM__WNDPROC, line 918 of ./include/customform.inc $081BE2A5 DELIVERMESSAGE, line 3469 of /home/silentcoder/lazarus/lcl/interfaces/gtk/gtkproc.inc $081C61E2 GTKFRMACTIVATEAFTER, line 522 of /home/silentcoder/lazarus/lcl/interfaces/gtk/gtkcallback.inc $B7BB1120 IPHTMLPV_init, line 51 of iphtml.pas $B7A55A2B IPHTMLPV_init, line 51 of iphtml.pas $B7A6B180 IPHTMLPV_init, line 51 of iphtml.pas $B7A6B92D IPHTMLPV_init, line 51 of iphtml.pas (wole:12919): Gtk-WARNING **: Error loading icon: Unable to load image-loading module: /usr/lib/gtk-2.0/2.4.0/loaders/svg_loader.so: libgsf-1.so.1: cannot open shared object file: No such file or directory (wole:12919): Gtk-WARNING **: Error loading icon: Unable to load image-loading module: /usr/lib/gtk-2.0/2.4.0/loaders/svg_loader.so: libgsf-1.so.1: cannot open shared object file: No such file or directory (wole:12919): GLib-GObject-WARNING **: gsignal.c:1788: instance `0x8401bb0' has no handler with id `664' (wole:12919): GLib-GObject-WARNING **: gsignal.c:1788: instance `0x840b838' has no handler with id `667' (wole:12919): GLib-GObject-WARNING **: gsignal.c:1788: instance `0x840bc90' has no handler with id `670' -- "there's nothing as inspirational for a hacker as a cat obscuring a bug by sitting in front of the monitor" - Boudewijn Rempt A.J. Venter Chief Software Architect OpenLab International www.getopenlab.com www.silentcoder.co.za +27 82 726 5103 _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
On Friday 19 May 2006 01:02, Felipe Monteiro de Carvalho wrote: > On 5/18/06, A.J. Venter <[EMAIL PROTECTED]> wrote: > > You may well be right, although I have no idea how to do a borderless > > window. My catch is I need this for a project due end of the month - so > > I'll help you anyway I can :) > > MyForm.BorderStyle := bsNone; Odd, I thought that didn't work under gtk1/2 > > I think the start point should be a new unit, for the notification > form. The form should be fully code generated. What is a good name for > this unit? NotificationForm? Well status message will be too easily confusable with statusbar messages. What I would suggest is that it be a completely separate COMPONENT. Then TrayIcon can have a handle to map to one. The reason I am thinking of this is that it would mean anybody with a different need could map one to just about any other component, hook it up to the onshowhint event and use it for more bigger fold-out hints where those are needed ? Thoughts anyone ? So perhaps then the right name would be something like NotificationHint or such ? > > My idea is to have 4 areas on the form: > > Title(TCaption)X button (TButton) > TImageDisplay Area(either a TCaption or a > custom control) > > It could be implemented in such a way that if Title and X button are > disabled, then DisplayArea and TImage move to the top of the form. If > TImage is disabled, Display Area moves to the left. I'm not sure what > alignment properties to use here. I like this. > > Also, should this window be created everytime it's shown? If not, then > it needs to be created at some point. I would say much rather have it created when whatever form it's attached to is created, like any other component. In the case of a tray-icon, it will then be created (hidden) along with the form the icon is connected to. So the programmer just needs to worry about show and hide methods - it should get created/destroyed along with the form it's used on. > > Also a system to have the display area contain either a caption or a > custom control needs to be created. I would use tcaption for now unless it really wouldn't work. It's allready canvas drawn, works well and stably - and means we get it out faster. > > KDE just closes on click or after a timeout - no need for an X. > > Ummm ... better to make it optional. I find it more confortable for > the user to see the X. It can be confused and not know how to close > the note immediately. Also Windows balloon has it, and they do a lot > of expensive usability researches =) Indeed, good point. Optional is the right way - then the coder can link it to the desktop his users will be on - active for windows, disabled for KDE etc. to integrate better into the over-all environment. I would leave the task of figuring out what desktop you are on with the coder using it however - some apps will only ever run on one platform/desktop - some on nearly every lazarus supported one - we cannot really dictate this. > > > What I would suggest would be the coolest however is to make our window a > > derivative of TIPiPRO htmlpanel. > > Ummm ... better to allow adding any component you like. I don't want > to add any dependencies. In retrospect, you are probably right. > > > I wouldn't bother with much else right now, rounded windows may look > > pretty but they are very hard to do without relying on stuff like X > > composite extensions. > > Yes, let's make it work. Latter someone can make it pretty. Aye, there are lots of little widget-set specific stunts you can use to get really funky window effects, but if somebody really wants those and (doesn't mind not compiling against others) - he can code it in through the handle. > > Just tested latest subversion lazarus + trayicon. It's working normally. Did you make any changes ? I'll test mine tomorrow (it's very late here) > > Looking back, I think I should have written it on pure X11. This would > avoid many problems, like having to rewrite on gtk2, qt, reling on > Handles that can change their meaning in the future, etc. But now it > is working well, and Murphy says that if you change something that is > working, it will stop working =) Pure X11 however will have meant sacrificing a lot. For starters the options for people to add some widget specifics using handles, even bigger - you would STILL need custom implementations for other platforms (e.g windows and carbon) - better then to be able to make maximum use of the underlying platform. More work - but better IMHO. Kina like my ScreenSize component uses two completely different approaches. Under X platforms it uses Xlib calls to get the screen dimensions, under windows it uses win32 api calls - but it provides a single clean component that gives the same results on either, so your app can compile and get the values regardless of what you are working on. That approach is probably the thing that introduces the single biggest delay in
Re: [lazarus] Show hint from code
On 5/18/06, A.J. Venter <[EMAIL PROTECTED]> wrote: You may well be right, although I have no idea how to do a borderless window. My catch is I need this for a project due end of the month - so I'll help you anyway I can :) MyForm.BorderStyle := bsNone; I think the start point should be a new unit, for the notification form. The form should be fully code generated. What is a good name for this unit? NotificationForm? My idea is to have 4 areas on the form: Title(TCaption)X button (TButton) TImageDisplay Area(either a TCaption or a custom control) It could be implemented in such a way that if Title and X button are disabled, then DisplayArea and TImage move to the top of the form. If TImage is disabled, Display Area moves to the left. I'm not sure what alignment properties to use here. Also, should this window be created everytime it's shown? If not, then it needs to be created at some point. Also a system to have the display area contain either a caption or a custom control needs to be created. KDE just closes on click or after a timeout - no need for an X. Ummm ... better to make it optional. I find it more confortable for the user to see the X. It can be confused and not know how to close the note immediately. Also Windows balloon has it, and they do a lot of expensive usability researches =) What I would suggest would be the coolest however is to make our window a derivative of TIPiPRO htmlpanel. Ummm ... better to allow adding any component you like. I don't want to add any dependencies. I wouldn't bother with much else right now, rounded windows may look pretty but they are very hard to do without relying on stuff like X composite extensions. Yes, let's make it work. Latter someone can make it pretty. Thanks It would be nicer to have wole done in GTK2, but that is not urgent, I don't need gtk2 for developing it. Just tested latest subversion lazarus + trayicon. It's working normally. Looking back, I think I should have written it on pure X11. This would avoid many problems, like having to rewrite on gtk2, qt, reling on Handles that can change their meaning in the future, etc. But now it is working well, and Murphy says that if you change something that is working, it will stop working =) -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
> I think the best solution here is not to copy or work on top of them, > but to implement our own notification system. I think that a small, > borderless LCL Window could do the trick. We can add some methods on > TTrayIcon to interact with this window. You may well be right, although I have no idea how to do a borderless window. My catch is I need this for a project due end of the month - so I'll help you anyway I can :) > > Here is a list of things we might want in out notification system: > > * text > * popup title > * icon (picture) > * time until the notification expires (add possibility to never > expire?). Add a possibility to link this to hint expire time? > * a X button to close the notification KDE just closes on click or after a timeout - no need for an X. What I would suggest would be the coolest however is to make our window a derivative of TIPiPRO htmlpanel. That way, you can use html to format the messages, embed pix, embed links whatever. Then just add an onclick so if you click outside any hotclicks, the messagewindow is close before the timeout. > > The appearance is another question. Simple rectangle is the most obvious. I wouldn't bother with much else right now, rounded windows may look pretty but they are very hard to do without relying on stuff like X composite extensions. > > Some way to change the appearance could be good. Since I´m thinking of > using a TForm for this, we could just give the TForm for the user and > let it play with it to create better looking notifications. That might well be the best approach - that way he can embed what HE needs, be it an html panel or timage. > > > A bigger issue for me right now is that it no longer works with GTK2 - it > > causes an instant segfault - oddly the backtrace shows it's calling on > > the GTK1 units ! > > I don't know why it would be linking they tray icon against gtk1 if my > > app is being linked to gtk2 - possibly because I run lazarus in gtk1, but > > I cannot test this theory since the current lazarus builds segfault in > > gtk2 > > No, this isn´t the cause. I just noticed this too. Until recently my > gtk1 Lazarus was correctly compiling TTrayIcon for Gtk2. Maybe Gtk2 > define changed? I am not on Linux now, but latter I will take a look. Thanks It would be nicer to have wole done in GTK2, but that is not urgent, I don't need gtk2 for developing it. Ciao A.J. -- "there's nothing as inspirational for a hacker as a cat obscuring a bug by sitting in front of the monitor" - Boudewijn Rempt A.J. Venter Chief Software Architect OpenLab International www.getopenlab.com www.silentcoder.co.za +27 82 726 5103 _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
Also, on the opposite direction of giving full access to the notification, we may want to limit access to it, to get a consistent user experience. -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
On 5/18/06, A.J. Venter <[EMAIL PROTECTED]> wrote: For what it helps, I did quite a bit of research and couldn't actually find anything in the GTK1.2 docs - in fact there is no mention of a trayicon component there (I assume it comes from somewhere close by though). I found at a gtk mailling list some info about tray icons on gtk 2. Here it is: http://mail.gnome.org/archives/gtk-devel-list/2005-August/msg00168.html Also some info about it on KDE: http://bugs.kde.org/show_bug.cgi?id=108076 I reckon the answer here is to go look at the code for something like an old version of gaim or such that uses gtk1 status mesages, and then implement it with calls to the handle - if I find the answer, I'll send you a patch. I think the best solution here is not to copy or work on top of them, but to implement our own notification system. I think that a small, borderless LCL Window could do the trick. We can add some methods on TTrayIcon to interact with this window. Here is a list of things we might want in out notification system: * text * popup title * icon (picture) * time until the notification expires (add possibility to never expire?). Add a possibility to link this to hint expire time? * a X button to close the notification The appearance is another question. Simple rectangle is the most obvious. Some way to change the appearance could be good. Since I´m thinking of using a TForm for this, we could just give the TForm for the user and let it play with it to create better looking notifications. A bigger issue for me right now is that it no longer works with GTK2 - it causes an instant segfault - oddly the backtrace shows it's calling on the GTK1 units ! I don't know why it would be linking they tray icon against gtk1 if my app is being linked to gtk2 - possibly because I run lazarus in gtk1, but I cannot test this theory since the current lazarus builds segfault in gtk2 No, this isn´t the cause. I just noticed this too. Until recently my gtk1 Lazarus was correctly compiling TTrayIcon for Gtk2. Maybe Gtk2 define changed? I am not on Linux now, but latter I will take a look. -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
> Actually, status messages is a to do for TTrayIcon. On Windows XP we > can use ballons to show status messages. A research needs to be done > about what people use on other operating systems / windows versions. A > small window may be a good choice, as it´s very portable. For what it helps, I did quite a bit of research and couldn't actually find anything in the GTK1.2 docs - in fact there is no mention of a trayicon component there (I assume it comes from somewhere close by though). I reckon the answer here is to go look at the code for something like an old version of gaim or such that uses gtk1 status mesages, and then implement it with calls to the handle - if I find the answer, I'll send you a patch. A bigger issue for me right now is that it no longer works with GTK2 - it causes an instant segfault - oddly the backtrace shows it's calling on the GTK1 units ! I don't know why it would be linking they tray icon against gtk1 if my app is being linked to gtk2 - possibly because I run lazarus in gtk1, but I cannot test this theory since the current lazarus builds segfault in gtk2 (I did a backtrace, all I could figure out is the segfault is somewhere in the pango libs, presumably this means there is a font bug in gtk2 that hits the IDE pretty hard). Ciao A.J. -- "there's nothing as inspirational for a hacker as a cat obscuring a bug by sitting in front of the monitor" - Boudewijn Rempt A.J. Venter Chief Software Architect OpenLab International www.getopenlab.com www.silentcoder.co.za +27 82 726 5103 _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Show hint from code
On 5/18/06, A.J. Venter <[EMAIL PROTECTED]> wrote: Hi all, Is there a way from code to tell a widget to show it's hint NOW regardless of the location of the pointer ? I am specifically interested in achieving this with TTrayIcon under Linux/GTK1 so my trayicon app can pop-up status messages. Actually, status messages is a to do for TTrayIcon. On Windows XP we can use ballons to show status messages. A research needs to be done about what people use on other operating systems / windows versions. A small window may be a good choice, as it´s very portable. thanks, -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Show hint from code
Hi all, Is there a way from code to tell a widget to show it's hint NOW regardless of the location of the pointer ? I am specifically interested in achieving this with TTrayIcon under Linux/GTK1 so my trayicon app can pop-up status messages. I cannot find anything that suggests it's possible but I thought I would ask anyway. Am I going to have to create a custom widget to get nice message popups ? A.J. -- "there's nothing as inspirational for a hacker as a cat obscuring a bug by sitting in front of the monitor" - Boudewijn Rempt A.J. Venter Chief Software Architect OpenLab International www.getopenlab.com www.silentcoder.co.za +27 82 726 5103 _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives