Dynamically Change icon (like iCal icon) (iPhone OS 3.1)
I'd like to be able to change the icon in a tab bar to reflect the current date...rather, I'd like to have a background image, with the date as a number on top of that—basically what the iCal icon on OS X does. Is there a way to create the number on that icon, or is this not possible?
musicwind95 wrote:
when I create the new tab, how do I know which one it's replacing?
I'm not sure you've seen the view hierarchy yet. Are you sure you set the "View Mode" switch to the Center position in the MainWindow.xib window (see the instructions for displaying the small-icon view hierarchy in my May 22 post).
If you're looking at the hierarchy (with all the nodes of the tree expanded), note each view controller owns a UITabBarItem object. This point is often misunderstood, since we see the tab bar items on the tab bar. But each tab bar item is a child of its controller, and the address of the tab bar item is stored in the 'tabBarItem' property of that controller. So when we replace the tab bar item in this line of the example:
- (void)awakeFromNib {
self.tabBarItem = tabItem;
We're setting the 'tabBarItem' property of 'self' to the address of a new tab bar item. Therefore we're changing the tab bar item for the controller which received the awakeFromNib message. If that controller is connected as the first child of the tab bar controller, we'll be changing tab bar item #1. If that controller is the second child, we'll be changing tab bar item #2, etc.
Of course if more than one view controller is an instance of the same custom class, e.g. FirstViewController is the class for both the first and third controllers, the tab bar items for both #1 and #3 will be reset when the respective controllers receive the awakeFormNib message. In that case we'd need a way to know whether 'self' was the address of the first or third controller. That could be done in several ways. For example, we could tag each controller's original tab bar item in IB. Then we might do something like the following to ensure the item replacement code only runs for the controller object which owns tab bar item #1:
- (void)awakeFromNib {
if (self.tabBarItem.tag == 1) {
// replace tab bar item
Once again, the above if-condition would only be needed if the first controller and one or more other controllers were of the same class.
Would this code be better off in the app delegate or the view controller?
The code belongs in a method of the view controller which wants its tab bar item to be replaced.
I've created the tab bar in IB (or rather, I started with a Tab Bar template), so I don't have a view controller for the tab bar itself.
Referring again to the small-icon view hierarchy in the MainWindow.xib window, note the tab bar is connected directly to the tab bar controller. The tab bar controller is the controller for the tab bar.
... In at least two of the tabs that I'm working in, I'm displaying a table view that leads to a navigational hierarchy. How would I set that up?
This time it's essential to be able to see the small-icon view hierarchy in the MainWindow.xib window. So please follow the instructions in my May 22 post in case you haven't done so already. Next, follow these steps (which assume tabs 3 and 4 will each bring up a table view under a nav bar which is controlled by a nav bar controller):
Add a new UIViewController subclass in Xcode for the tab 3 controller. Check both Options so the new class will be a subclass of UITableViewController, and a matching XIB file will be created;
Name the subclass ThirdViewController (name it whatever you want, but the class will be referred to as ThirdViewController here);
Open MainWindow.xib, make sure the XIB window is visible (Window->Document) and its View Mode switch is in the Center position, then expand the small icon tree so you can see all the view controllers under the Tab Bar Controller;
Drag a UINavigationController object into the XIB window, and drop it onto the Tab Bar Controller icon. If you only had two controllers to start with, the Nav Controller object should now be in the last (3rd) position. If you already had a third controller, drag the Nav Controller icon to place it under the second controller. The Nav Controller icon should now be in the third position;
Expand the Nav Controller subtree, and select the Root View Controller icon;
Open the Identity Inspector and set the Class of the Root View Controller to ThirdViewController;
Open the Attributes Inspector and set the Nib Name to ThirdViewController;
If you checked "With XIB for user interface" when making the ThirdViewController class in the first step, ThirdViewController.xib should already be setup correctly; i.e. File's Owner will be set the ThirdViewController class, the 'view' outlet of File's Owner will be connected to a Table View object, and the Table View's delegate and dataSource outlets will be connected to File's Owner;
Open ThirdViewController.xib, select the Table View and locate the Simulated User Interface Elements group;
Set Top Bar to Navigation Bar. This optional setting will paint a dummy nav bar in the Table View editor window and cause the size of the Table View to be adjusted to fit. The dummy nav bar is just a placeholder for the real one which will be created at runtime. You can't place controls on the dummy bar; it's just to help you see how the screen will look;
Repeat the above steps to add a nav controller at position 4, making a FourthViewController class for the root controller;
If you now have too many tab positions, you can delete each extra controller by selecting its icon and selecting Edit->Delete.
That should complete the project skeleton, and you should now be able to Build and Go. You won't see the table views though, until you set up the data source methods in the respective controller implementations.
- Ray
Similar Messages
-
Dynamically change icon name of push button
Hi,
I would like to ask how to dynamically change the icon name attribute of a push button in dialog programming. What is the syntax for assigning an icon name during runtime?
I am currently doing a multiple selection function for KNA1-KUNNR.
Initially, the icon name is ICON_ENTER_MORE. When the user picks up more than one customer, it should automatically change to ICON_DISPLAY_MORE. How can I do this?
here's the code i currently have:
DESCRIBE TABLE kunnr_ran LINES l_kunnr.
IF l_kunnr > 1.
g_add_multiple = 'X'.
BT_MULT_CUST-icon_name = 'ICON_DISPLAY_MORE'.
ELSEIF l_kunnr = 1.
CLEAR g_add_multiple.
BT_MULT_CUST-icon_name = 'ICON_ENTER_MORE'.
ENDIF.
The name of my pushbutton is BT_MULT_CUST.
The code in ** is not correct. I don't know the syntax in SAP. But that is how it is done in VB for example.
Thank you.
che =)If you have not found your answer already, please try the following:
1) In screen layout painter: for the pushbutton in question (i.e. pb_multi_select), mark the "Output field" on the program attributes tab in the attributes window for the pushbutton. Make sure that its visible length is at least 2 too. This will "gray out" the "Text" and other fields.
2) In the TOP INCLUDE of the module program: add a variable for the pushbutton that is of type "icons-text" and don't forget to include <icons>. Below is an example
INCLUDE <icon>
DATA: pb_multi_select TYPE icons-text.
3) In a module called in the PBO modules for the screen that needs its button changed, call the function "ICON_CREATE" and pass at minimum the name of the icon and the field that you specified in step 2. Below is an example using the icon "ICON_DISPLAY_MORE", "ICON_ENTER_MORE", and a flag variable "MULTI_SEL_INFO_EXISTS" that indicates if any multiple selection information has already been entered. It would be set by the program (not automatically, but by coding) prior to the "IF" statement:
IF multi_sel_info_exists = 'X'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_DISPLAY_MORE'
IMPORTING
result = pb_multi_select.
ELSE.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_ENTER_MORE'
IMPORTING
result = pb_multi_select.
ENDIF.
You can change the button as you see fit with multiple different calls inside of "IF" or "CASE" statements. Please see documentation for "ICON_CREATE" for other parameters.
Hope this helps,
Brian -
Someone changed the settings on my iPhone so that I can no longer update or add apps. The icon no longer appears. Can someone please tell me how to add that back?
I should have added that the iTunes app is not displayed on my phone in order for me to add the apps.
-
How to change icons of a JTree node dynamically
Hi all!
I want to change icon associated with a node dynamically ( i.e. after the tree has being displayed). How can i achieve this?
Can any one provide me a sample code snippet.
Thanks in advance
MuraliI have created CustomCellRenderer and i'm calling this class as follows
tree.setCellRenderer((TreeCellRenderer) new CustomCellRenderer(true));
The boolean value for the constructor (in this case it's true) will be set to
a local variable in the CustomCellRenderer class. Then upon clicking a node in the tree the boolean value (true) is set and the icon for that node should be changed as specified in the CustomCellRenderer class.
When i click on a node all the icons of that tree are disappearing.
Can any one help me in this issue
public class CustomCellRenderer
extends JLabel
implements TreeCellRenderer
private ImageIcon grayfolderImage;
private ImageIcon greenfolderImage;
private ImageIcon bluefolderImage;
private ImageIcon redfolderImage;
private ImageIcon whitefolderImage;
private boolean bSelected;
boolean logfileDeleted;
public CustomCellRenderer()
grayfolderImage = new ImageIcon("C:\\images\\grayFolder.gif");
greenfolderImage = new ImageIcon("C:\\images\\greenFolder.gif");
bluefolderImage = new ImageIcon("C:\\images\\blueFolder.gif");
redfolderImage = new ImageIcon("C:\\images\\redFolder.gif");
whitefolderImage = new ImageIcon("C:\\images\\whiteFolder.gif");
public CustomCellRenderer(boolean logfileDeleted){
this.logfileDeleted = logfileDeleted;
public Component getTreeCellRendererComponent( JTree tree,
Object value, boolean bSelected, boolean bExpanded,
boolean bLeaf, int iRow, boolean bHasFocus )
// Find out which node we are rendering and get its text
DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
String labelText = (String)node.getUserObject();
this.bSelected = bSelected;
// Set the correct foreground color
/*if( !bSelected )
setForeground( Color.black );
else
setForeground( Color.red ); */
// Determine the correct icon to display
if( labelText.equals( "ioexception001" ) )
setIcon( redfolderImage );
else if( labelText.equals( "ioexception002" ) )
setIcon( greenfolderImage );
else if( logfileDeleted ==true )
setIcon( whitefolderImage );
else if( labelText.equals( "ioexception004" ) )
setIcon( redfolderImage );
else
setIcon(bluefolderImage);
// Add the text to the cell
setText( labelText );
return this;
// This is a hack to paint the background. Normally a JLabel can
// paint its own background, but due to an apparent bug or
// limitation in the TreeCellRenderer, the paint method is
// required to handle this.
public void paint( Graphics g )
Color bColor;
Icon currentI = getIcon();
// Set the correct background color
bColor = bSelected ? SystemColor.textHighlight : Color.white;
g.setColor( bColor );
// Draw a rectangle in the background of the cell
g.fillRect( 0, 0, getWidth() - 1, getHeight() - 1 );
super.paint( g );
} -
CANNOT change Icons in the dock or other places like I used to in 10.5.8
I found a nice set of icons that I would like to set to my MBP that I recently upgraded to Snow Leopard. So far I really haven't had any real problems that I wasn't able to work through except for this one. I've even opened up the "Info" box and changed the sharing and the permissions and changed them so that as an administrator I could change the icon but no luck! On my G5 tower I have no problem at all using the standard procedure but when I apply it to my laptop it just doesn't want to work. I'd appreciate any suggestions.
ThanksI've been playing around with that problem for a bit now: Apple changed it with Leopard and Snow Leopard and it's not as easy as it was with Tiger... but I found a way around it:
When you control click on any of your folders (to the right of the System Prefs icon), you need to have the following checked:
Sort by: Name
Display as: Folder
View content as: List
Having changed icons dozens of times, I found that any other setting will keep your pretty icon within a Finder window, but as soon as move it to the Dock, it'll revert to the stock view.
So, once you choose above settings, go ahead and change an icon on one of your folders and then drag it into the dock. It should work - mine have been there for 2 weeks now. -
Change iconic file dynamically..
Hello Friends ...
I m working on menu .. I want to change iconic file dynamically..
I m using for this
if condition then
Set_Menu_Item_Property('DW',ICON_NAME,'comp1');
else
Set_Menu_Item_Property('DW',ICON_NAME,'comp2');
end;
'DW' = menu item
comp = iconic file name
but iconic file not changing ..
Thanks....
Edited by: user10502250 on Jan 21, 2010 2:24 AM
Edited by: user10502250 on Jan 21, 2010 2:24 AMHello ...
Thanx for reply ...
abt form builder version
orms [32 Bit] Version 10.1.2.0.2 (Production)
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Oracle Toolkit Version 10.1.2.0.2 (Production)
PL/SQL Version 10.1.0.4.2 (Production)
Oracle Procedure Builder V10.1.2.0.2 - Production
PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
Oracle Query Builder 10.1.2.0.2 - Production
Oracle Virtual Graphics System Version 10.1.2.0.2 (Production)
Oracle Tools GUI Utilities Version 10.1.2.0.2 (Production)
Oracle Multimedia Version 10.1.2.0.2 (Production)
Oracle Tools Integration Version 10.1.2.0.2 (Production)
Oracle Tools Common Area Version 10.1.2.0.2
Oracle CORE 10.1.0.4.0 Production -
I have made a bookmark toolbar with all my fav sites, a lot of sites have not made a icon logo, so I make one,,, By using the change icon in properties (right click on the icon) But this feature is not in the newest firefox update.
How can I get it again? is there a specific extension fx??Perform the suggestions mentioned in the following articles:
* [[Latest Firefox issues#os=mac&browser=fx9|Icons missing in the Bookmarks menu]]
Or use this extension to restore missing Favicons --> '''CheckPlaces 2.6.1'''
* https://addons.mozilla.org/en-US/firefox/addon/checkplaces/
Check and tell if its working. -
Changed Icon for my InputListOfValues
Well my problem is that I want to changed the search icon of my InputListOfValues but just for one!..
Well my css looks like this:
/* definition of the alias*/
.StyleLov1:alias
{-tr-inhibit: background-image;
font-size: 11px;
padding: 1px 3px;
text-decoration: none;
vertical-align: 0%;}
/* referencing the alias in the StyleLov1*/
af|inputListOfValues.StyleLov1::search-icon-style
-tr-rule-ref:selector(".StyleLov1:alias");
/* definition of the alias*/
.StyleLov2_alias
{ content: url("../images/activar.png");}
/* referencing the alias in the StyleLov2*/
af|inputListOfValues.StyleLov2::search-icon
-tr-rule-ref:selector(".StyleLov2:alias");
And in my component looks like this:
<af:inputListOfValues label="Label 1"
popupTitle="Search and Result Dialog"
binding="#{backingBeanScope.backing_lovsample_test.ilov1}"
id="ilov1"
styleClass="StyleLov1 StyleLov2"/>
The first style "StyleLov1" works but the second don't works I don't know what is the error.
Thanks
EdmaralThanks now it works fine!!!....but in my general CSS file I define global selectors por InputListOfValues like this:
GLOBAL DEFINITION
af|inputListOfValues::search-icon-style { -tr-inhibit: background-image; padding: 0px 0px; text-decoration: none;vertical-align:-3px; }
af|inputComboboxListOfValues::dynamic-help-icon {content: ‘?’; color: black}
af|inputListOfValues::search-icon {content : url("../images/lovMenuEnabled.png"); position: relative; left: -3px; top: 1px; }
af|inputListOfValues::search-disabled-icon {content: url("../images/lovMenuDisabled.png"); font-weight: bold;}
af|inputListOfValues::search-icon-style:disabled { -tr-inhibit: background-image; padding: 0px 0px; text-decoration: none;vertical-align:-3px; }
DEFINITION FOR SPECIFIC SELECTOR
/* definition of the alias*/
.StyleLov2:alias{ /* notice .StyleLov2:alias instead of .StyleLov2_alias */
background-image: url("../images/activar.png"); /* notice background-image instead of content */
/* referencing the alias in the StyleLov2 */
af|inputListOfValues.StyleLov2::search-icon-style{ /* notice search-icon-style instead of search-icon */
-tr-rule-ref:selector(".StyleLov2:alias");
Changing all icons for this component but I want to change the icon just in one component but the global property is apply for all components. I change the
style class with de name of my selector alias in my component but is not being recognized just recognized the global selector. I dont know how to
inhibit these global properties.
Thanks.....
Edmaral
Edited by: Edmaral on 17-may-2010 13:12 -
how to change icon for all of the tile type? not just one, but all!
Changing the file icon will not enable Quicktime to play Matroska files. Changing the file suffix might.
It could be a 'difficult' form of Matroska file. FYI Matroska is just a container like MOV or AVI, and some mkv have the video encoded with Real Video Codec (RV9 RV10). Perian+QT can't decode this, but VLC will play .mkv files just fine on OS X, as long as they don't use H.264!
It's a bit of a lottery until Matroska decide to support the Apple platform. I have found this:
http://mkv4mac.free.fr/index.php?lang=en&p=lec
which may help.
But there may be another workaround: 1. Get Info the mkv file
2. Change to extension to wmv. Save as wmv and that could work better.
Or this link may be helpful:
http://www.squidoo.com/mkv-converter-mac
Recently, a poster (ZachP14) suggested this:
"There's a program called Plex that runs .mkv files awesome on my 2.0 ghz macbook."
http://www.plexapp.com/
Maybe worth a try?
More information here:
ttp://en.wikipedia.org/wiki/Matroska -
Changing Icons & Reverting to Old?
Can someone please explain how to change icons on both the dock and desktop as well as a good site with cool new icons?
Also - if I change an icon, how do I go about reverting to the old one?
Thanks.click on the icon or folder...
Press Apple+i
The window will pop up
Find the icon you WANT
Do the same - select it, press Apple+i
Then in the top left corner you will see a mini icon. Click that so it's selected.
Hit Apple+C
Then select the icon you want to replace. Click on that so it's selected
Hit Apple+V
If it doesn't show up, just do it again.
To REMOVE an icon - same thing - press apple+i on the file you want to remove the icon on
Click the little icon in the top left corner so it's selected
Hit Apple+X
The icon reverts to the ORIGINAL icon.
As mentioned above, there are other programs, that you pay for, that can do this for you automatically, and can change icons within say browsers and such (like your little finder icons, etc). It's cool for about 10 minutes, but I don't think it's worth the money.
Make sure to check out apple.com downloads, iconfactory, and many other websites for apple icons, there are a TON out there. -
[SOLVED] change icons in thunar (XFCE)
Hello all,
Me again. Is there a way to change the icon colors in Thunar? I copied the gnome-wine, gnome-wise, etc. from my Xubuntu test box and copied them to /usr/share/icons. I can see they show up under System Settings, Appearance/Icons. I can even select them, but only the icons on the desktop change colors (call me crazy, but I like the green folder icons). However, the icons in thunar are still the grayish brown standard icons.
Is there a way to have the thunar icons use the XFCE system icons?
--nixIT
Last edited by nixIT (2011-06-03 16:17:00)in xfce4 (4.8.0.3, the version I am using in ubuntu):
You can do this to chang the icons in thunar and through the xfce desktop
1) Click the main menu (Xfce menu at the bottom-left of the screen)
2) Click Settings -> Appearance
On Appearance dialog:
1) Click Icons tab (or press alt+i)
2) if you have icon themes installed you can selec them (such as Tango)
-- this will change iconds for the entire desktop:
Thunar, Xfce menu, etc
EDIT: I now realize that this was about changing icon colors and the above was already noted in the first post
.. any way it helped me change my icon theme to Tango...thanks
Last edited by NeoH4x0r (2012-07-01 23:32:11) -
Mission impossible: changing icons in dialogs?
Hi, Is it really impossible to change icons in dialogs in a straightforward manner? I am new to Java Swing but have used most GUI:s and really never encountered any problems changing icons in the caption part of a window frame (upper left corner). If such common practice is as hard as it seems in Java, it must be considered a major flaw! Please take a look at the problem and enlighten me.
It is easy to replace the default �coffee cup� icon in the main application window (a JFrame) with a new icon in file "main.gif",
Toolkit kit = Toolkit.getDefaultToolkit();
Image icon = kit.getImage(�main.gif");
setIconImage(icon);
The following creates a non-modal dialog window (one the user mustn't close before doing something else),
Dialog status = new JDialog(this,"Status",false);
The dialog will have the main JFrame as its parent and inherit its icon. Fine, but I want some other icon in this dialog, for example a toolbar icon in file "status16.gif". The only way to do it seems to be to introduce a �dummy� Jframe like this,
JFrame frame = new JFrame();
Image icon = kit.getImage("status16.gif");
frame.setIconImage(icon);
Dialog status = new JDialog(frame,"Status",false);
The dialog now sports the status icon, but there is a dire side-effect of this fix. The main JFrame will no longer be the parent of the dialog (the 'dummy' JFrame will) and this has consequences. For example when the user activates the application main window by clicking on it, the dialog window will no longer automatically place itself on top. A work-around would involve explicitly writing dialog window management code.
It shouldn�t be this complicated to accomplish something as simple as an icons change. I must have missed something important here.
Best Regards, Ulf JohanssonDOMO, I too can't get the bug links to work. I suspect many have encountered my "icon in dialog"-problem but given up. It's a frustrating flaw. If nobody comes up with a soulution I'll file a bug report for what it's worth. Sun should take these 'minor' issues seriously. In C# it's a breeze.
/Ulf Johansson -
Change icon (advanced?!)
Hi all,
I have just finished an application and even created installer(all the needed certificates, languages etc.) for it. All of my application's icons are custom, so I was wondering if I can change the PackageMaker's default (.pkg) icon - the orange box with something yellow coming out of it - to the same(consistent) with my application icon? Is there any chance of doing that? I tried all the simple things - read some package maker manuals, googled my question, checked the archive in the forum and tried to ctrl-click on the installer's .pkg with the hope there will be the magic(windows) option change icon No success until now. Any ideas?
Regards
- artOf...Thank you very much! Magic indeed
The image is changed but to something that I can only describe as the default .icns or default .pgn image (i tried both). So, now my installer icon looks either like a default .icns file or default .pgn file(it lacks the nice "preview" functionality that shows me the actual image in the .icns/.pgn file). I am still missing something, should the image be of specific format(other than .icns) or should it have certain size? Sorry about my newbie questions.
Respect
- artOf... -
Change icon for S object in PPOME
Hello!
Do you have any idea how to change icon for position like it works for manager (012 connection type)? I'd like to create my own indication for special statuses of position.
SAP offers standart solution http://help.sap.com/saphelp_nw04/helpdata/en/24/1188b3cbc711d2b49e006094b9c9b4/content.htm
but it's disabled as SAP Support Team said.Hi,
Not sure it will help.Have a look at
SPRO> Personnel Management> Organizational Management>Hierarchy Framework
Manoj. -
Why is the Calender app the only app that changes icons? I mean wouldn't it be great to have the clock icon show the actual time? Or a weather app that shows the weather and/or temperature on the icon.
Those are nice changes, Apple would need to implement them.
You can submit feedback to Apple: http://www.apple.com/feedback/iphone.html.
Maybe you are looking for
-
Syntax problem with BDC perform
Dear Friends, small problem in BDC Perform syntax but I am not getting how to do this.. I have writen the code like this in my BDC byt its throughing the error...Here I want to do the validation on each and every field. I mean If that field values ar
-
I need to capture bind values in SQL Trace. I am running Oracle 9.2.0.8. I will be running my queries from an application, not SQL Plus. I can use a after log on trigger to turn on trace. Has anyone done this with success? Are there any other ways to
-
Need to display Information message in two lines - Alignment problem
Hi all, In a screen program, I am trying to display an information/Confirmation message to confirm few things from user side. For this I am using POPUP_TO_CONFIRM FM. This FM enables me to display a text question. My question would be "'New Price 40
-
What is wrong with CS6 crop?
I can't understand why they removed the 3rd box for resolution that they had before, after width and height. It seems to have screwed up the way crop works. sometimes, I type in numbers such as 12 x 9 inches and some other crop happens. I had create
-
CPI2.0 RSL #2032 error while adding NAM Datasources
Hello, Despite implemented the RSL-Flash Patch allready, I get into this error when trying to add NAM Datasources at Administration > System Settings > Data Sources after having the HTTPS credentials for the NAM's configured. The RSL-Flash Patch was