|
From: <and...@hi...> - 2009-03-03 06:57:18
|
Hi Almar Unfortunately, setting the icon is something that is under the control of the window manager, not the toolkit. This is the same for Windows or for Linux or Max. Therefore, there is first no portable way to do it and second, you have to use OS calls to do it. Best regards Andreas ---- Almar Klein <alm...@gm...> schrieb: > Hi, > > Thanks for the response. > Too bad you'd need pywin32 for this though... > > Almar > > 2009/3/2 <and...@hi...> > > > Hi Almar > > > > This was once discussed here, although a very long time ago. Basically, it > > goes like this: > > > > This is system dependent. Here my solution for Windows (worked on W2K): > > > > import win32con, win32gui > > > > def set_icon(window, icon_path): > > if os.path.isfile(icon_path): > > try: > > hwnd = fl_xid(window) > > icon = win32gui.LoadImage(0, icon_path, win32con.IMAGE_ICON, > > 0,0,win32con.LR_DEFAULTSIZE | win32con.LR_LOADFROMFILE) > > win32gui.SendMessage(hwnd, win32con.WM_SETICON,win32con.ICON_BIG,icon) > > win32gui.SendMessage(hwnd, win32con.WM_SETICON,win32con.ICON_SMALL, > > icon) > > except: > > pass > > > > > > gui = Fl_Window(1100, 700, "Icon Test") > > gui.show() > > > > set_icon(gui, "logo.ico") > > > > Fl.run() > > > > For Unix based systems, there is something similar which I have never tried > > myself. However, if you follow the approach as described in the FLTK manual > > you should be OK. > > > > > > ---- Almar Klein <alm...@gm...> schrieb: > > > Hi, > > > > > > How can I set the icon for my application? > > > I cant get it to work and cant find a proper example neither... > > > The icon is defined in a normal .ico file. > > > Using win32 and fltk 1.x > > > > > > Thankx, > > > Almar > > > > |